For an ember array you can simply do this:
array.get('firstObject');
to get the first object in array.
or this:
array.get('lastObject');
to get last object in array.
How do I get something by its index? similar to how it works in an ordinary javascript array:
array[index];
Looking at the documentation, you could just do var myObject = array.objectAt(someIndex);
, and that will return the object at that specific index. You can check the documentation here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With