While looking through apps written with Ember.js, I noticed that sometimes arrays are defined with a call to Ember.A() and sometimes array literals are used. When I ran Ember.A([1]) in the browser console, the return value looks just like an array and arrays created using array literals had the Ember.js methods pushObject and friends. Is the call to Ember.A() just a way to define an Ember.Array when you don’t use prototype extensions? Otherwise are arrays all created equal?
While looking through apps written with Ember.js, I noticed that sometimes arrays are defined
Share
Your question contains the correct answer:
Ember.A()just a way to define anEmber.Arraywhen you have turned off the prototype extensions. You’ll notice that Ember’s internal code always usesEmber.A().