AssociativeArray - Cesium Documentation

# AssociativeArray

#### new AssociativeArray()

  A collection of key-value pairs that is stored as a hash for easy lookup but also provides an array for fast iteration.
  Source: Core/AssociativeArray.js, line 18

### Members

#### length :Number

  Gets the number of items in the collection.
  Source: Core/AssociativeArray.js, line 30

#### values :Array

  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.
  Source: Core/AssociativeArray.js, line 43

### Methods

#### contains(key) → Boolean

  Determines if the provided key is in the array.

  Name | Type | Description
  --- | --- | ---
  `key` | String | Number | The key to check.

  ##### Returns:

  `true` if the key is in the array, `false` otherwise.
  Source: Core/AssociativeArray.js, line 56

#### get(key) → Object

  Retrieves the value associated with the provided key.

  Name | Type | Description
  --- | --- | ---
  `key` | String | Number | The key whose value is to be retrieved.

  ##### Returns:

  The associated value, or undefined if the key does not exist in the collection.
  Source: Core/AssociativeArray.js, line 93

#### remove(key) → Boolean

  Removes a key-value pair from the collection.

  Name | Type | Description
  --- | --- | ---
  `key` | String | Number | The key to be removed.

  ##### Returns:

  True if it was removed, false if the key was not in the collection.
  Source: Core/AssociativeArray.js, line 108

#### removeAll()

  Clears the collection.
  Source: Core/AssociativeArray.js, line 128

#### set(key, value)

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

  Name | Type | Description
  --- | --- | ---
  `key` | String | Number | A unique identifier.
  `value` | Object | The value to associate with the provided key.

  Source: Core/AssociativeArray.js, line 72