Ember.MapWithDefault Class packages/ember-metal/lib/map.js:320


PRIVATE

Show:

Methods

Properties

Show:

copy

Ember.MapWithDefault
Inherited from Ember.Map but overwritten in packages/ember-metal/lib/map.js:371

create

(options) Ember.MapWithDefault|Ember.Map static
Inherited from Ember.Map but overwritten in packages/ember-metal/lib/map.js:334

Parameters:

options

Returns:

Ember.MapWithDefault|Ember.Map
If options are passed, returns `Ember.MapWithDefault` otherwise returns `Ember.Map`

forEach

(callback, self)

Iterate over all the keys and values. Calls the function once for each key, passing in the key and value, in that order.

The keys are guaranteed to be iterated over in insertion order.

Parameters:

callback Function
self *
if passed, the `this` value inside the callback. By default, `this` is the map.

get

(key) *
Inherited from Ember.Map but overwritten in packages/ember-metal/lib/map.js:352

Retrieve the value associated with a given key.

Parameters:

key *

Returns:

*
the value associated with the key, or the default value

has

(key) Boolean

Check whether a key is present.

Parameters:

key *

Returns:

Boolean
true if the item was present, false otherwise

remove

(key) Boolean

Removes a value from the map for an associated key.

Parameters:

key *

Returns:

Boolean
true if an item was removed, false otherwise

set

(key, value)

Adds a value to the map. If a value for the given key has already been provided, the new value will replace the old value.

Parameters:

key *
value *
Show:

length

number

This property will change as the number of objects in the map changes.

Default: 0