insertAt (idx, object) Ember.Arraypublic
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
Please login to continue.