O'Reilly logo

Ember.js Cookbook by Erik Hanchett

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using enumerables with arrays

The Ember.Enumerable methods are very important when dealing with arrays. In these recipes, we'll look at some common use cases.

Getting ready

To understand how to use enumerables, we must first take a look at the standard JavaScript array methods and their equivalents using observable enumerables:

Standard method

Observable equivalent

unshift

unshiftObject

shift

shiftObject

reverse

reverseObjects

push

pushObject

pop

popObject

We'll be using some of these methods in our examples, so keep in mind what the standard and observable equivalents are.

The Ember.Enumerable class has several methods that we can use in our Ember applications. Here is the list of the more common methods and what they do:

Enumerable ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required