MutableArray#insertAt()

insertAt (idx, object) Ember.Arraypublic

Defined in packages/ember-runtime/lib/mixins/mutable_array.js:113

This will use the primitive replace() method to insert an object at the specified index.

let colors = ['red', 'green', 'blue'];

colors.insertAt(2, 'yellow');  // ['red', 'green', 'yellow', 'blue']
colors.insertAt(5, 'orange');  // Error: Index out of range

Parameters:

idx Number
index of insert the object at.
object Object
object to insert

Returns:

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

Please login to continue.