Computed Properties and Aggregate Data

Sometimes you have a computed property whose value depends on the properties of
items in an array. For example, you may have an array of todo items, and want
to calculate the incomplete todo's based on their isDone property.

Note that @each only works one level deep. You cannot use nested forms like
todos.@each.owner.name or todos.@each.owner.@each.name.

Sometimes you don't care if properties of individual array items change. In this
case use the [] key instead of @each. Computed properties dependent on an array
using the [] key will only update if items are added to or removed from the array,
or if the array property is set to a different array. For example:

Here, indexOfSelectedTodo depends on todos.[], so it will update if we add an item
to todos, but won't update if the value of isDone on a todo changes.

Several of the Ember.computed macros
utilize the [] key to implement common use-cases. For instance, to
create a computed property that mapped properties from an array, you could use
Ember.computed.map
or build the computed property yourself:

The computed macros expect you to use an array, so there is no need to use the
[] key in these cases. However, building your own custom computed property
requires you to tell Ember.js that it is watching for array changes, which is
where the [] key comes in handy.