AssociativeArray

external class AssociativeArray(source)

A collection of key-value pairs that is stored as a hash for easy lookup but also provides an array for fast iteration.

See also

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
var length: Int

Gets the number of items in the collection.

Link copied to clipboard

Gets an unordered array of all values in the collection. This is a live array that will automatically reflect the values in the collection, it should not be modified directly.

Functions

Link copied to clipboard
fun contains(key: Int): Boolean

Determines if the provided key is in the array.

Link copied to clipboard
operator fun get(key: Int): Any

operator fun get(key: String): Any

Retrieves the value associated with the provided key.

Link copied to clipboard
fun remove(key: Int): Boolean

fun remove(key: String): Boolean

Removes a key-value pair from the collection.

Link copied to clipboard
fun removeAll()

Clears the collection.

Link copied to clipboard
operator fun set(key: Int, value: Any)

operator fun set(key: String, value: Any)

Associates the provided key with the provided value. If the key already exists, it is overwritten with the new value.