Enumerables

In Ember.js, an enumerable is any object that contains a number of child
objects, and which allows you to work with those children using the
Ember.Enumerable API. The most common
enumerable in the majority of apps is the native JavaScript array, which
Ember.js extends to conform to the enumerable interface.

By providing a standardized interface for dealing with enumerables,
Ember.js allows you to completely change the way your underlying data is
stored without having to modify the other parts of your application that
access it.

The enumerable API follows ECMAScript specifications as much as
possible. This minimizes incompatibility with other libraries, and
allows Ember.js to use the native browser implementations in arrays
where available.

Use of Observable Methods and Properties

In order for Ember to observe when you make a change to an enumerable, you need
to use special methods that Ember.Enumerable provides. For example, if you add
an element to an array using the standard JavaScript method push(), Ember will
not be able to observe the change, but if you use the enumerable method
pushObject(), the change will propagate throughout your application.

Here is a list of standard JavaScript array methods and their observable
enumerable equivalents:

Standard Method

Observable Equivalent

pop

popObject

push

pushObject

reverse

reverseObjects

shift

shiftObject

unshift

unshiftObject

Additionally, to retrieve the first and last objects in an array
in an observable fashion, you should use myArray.get('firstObject') and
myArray.get('lastObject'), respectively.

If you only want to return the first matched value, rather than an Array
containing all of the matched values, you can use find() and findBy(),
which work like filter() and filterBy(), but return only one item.

Aggregate Information (Every or Any)

To find out whether every item in an enumerable matches some condition, you can
use the every() method: