W3cubDocs

/Kotlin

Json

external interface Json

Platform and version requirements: JS

An interface for indexing access to a collection of key-value pairs, where type of key is String and type of value is Any?.

Functions

get

abstract operator fun get(propertyName: String): Any?

Calls to the function will be translated to indexing operation (square brackets) on the receiver with propertyName as the argument.

set

abstract operator fun set(propertyName: String, value: Any?)

Calls of the function will be translated to an assignment of value to the receiver indexed (with square brackets/index operation) with propertyName.

Inherited Functions

equals

open operator fun equals(other: Any?): Boolean

Indicates whether some other object is "equal to" this one. Implementations must fulfil the following requirements:

hashCode

open fun hashCode(): Int

Returns a hash code value for the object. The general contract of hashCode is:

toString

open fun toString(): String

Returns a string representation of the object.

Extension Functions

add

fun Json.add(other: Json): Json

Adds key-value pairs from other to this. Returns the original receiver.

© 2010–2017 JetBrains s.r.o.
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.js/-json/