In Ember Array, how do I access an object by index value? Ember js

For an ember array, you can simply do this:

array.get('firstObject'); 

to get the first object in the array.

or that:

 array.get('lastObject'); 

to get the last object in the array.

How do I get something by its index? similar to how it works in a regular javascript array:

array [index];

+5
source share
1 answer

Looking at the documentation, you can simply do var myObject = array.objectAt(someIndex); , and this will return the object at that particular index. You can check the documentation here.

+16
source

All Articles