MutableArray#addObject()

addObject (obj) Ember.Arraypublic

Inherited from Ember.MutableEnumerable but overwritten in packages/ember-runtime/lib/mixins/mutable_array.js:379

Push the object onto the end of the array if it is not already present in the array.

let cities = ['Chicago', 'Berlin'];

cities.addObject('Lima');    // ['Chicago', 'Berlin', 'Lima']
cities.addObject('Berlin');  // ['Chicago', 'Berlin', 'Lima']

Parameters:

obj *
object to add, if not already present

Returns:

Ember.Array
receiver
doc_EmberJs
2016-11-30 16:52:33
Comments
Leave a Comment

Please login to continue.