API Docs for: 7.2
Show:

MQA.MapClass Class

Module: MQA

Provides a base class to extend Objects with, giving them Map-like behavior.

Using a prototypical class will speed iteration for cases when we are not decorating an existing object

Constructor

MQA.MapClass

() private

Methods

each

(
  • callback
)

Enumerates all values in the map, passing the value as the first parameter to the callback and the key as the second. The key only has meaning for primitives.

Parameters:

get

(
  • key
)

Get a value based on a key. The key is translated by the keyFunction.

Parameters:

keys

() Array

Returns an array of the keys associated with the collection.

Returns <Array>

an array of strings, representing the keys in the collection.

list

(
  • ary
)
Array

"Bless" a JavaScript array into a list. If no array is specified, then create a new array and bless it.

Parameters:

  • ary Array

    the array instance to convert

Returns <Array>

the given array instance, with added list methods

map

(
  • obj
)
Object

"Bless" a JavaScript object into a map. If no object is specified, then create a new object and bless it.

Parameters:

  • obj Object

    the object to convert

Returns <Object>

object with collection methods

put

(
  • key
  • value
)

Puts a binding. Returns the previous value.

Parameters:

remove

(
  • key
)

Remove a binding. Return the existing value.

Parameters: