Class Ember.NativeArray
publicThe NativeArray mixin contains the properties needed to make the native
Array support MutableArray and all of its dependent APIs. Unless you
have EmberENV.EXTEND_PROTOTYPES
or EmberENV.EXTEND_PROTOTYPES.Array
set to
false, this will be applied automatically. Otherwise you can apply the mixin
at anytime by calling Ember.NativeArray.apply(Array.prototype)
.
[] public
Inherited from EmberArray packages/@ember/-internals/runtime/lib/mixins/array.ts:373
- returns
- this
This is the handler for the special array content property. If you get this property, it will return this. If you set this property to a new array, it will replace the current content.
1 2 3 4 5 6 |
let peopleToMoon = ['Armstrong', 'Aldrin']; peopleToMoon.get('[]'); // ['Armstrong', 'Aldrin'] peopleToMoon.set('[]', ['Collins']); // ['Collins'] peopleToMoon.get('[]'); // ['Collins'] |
firstObject Object | undefined public
Inherited from EmberArray packages/@ember/-internals/runtime/lib/mixins/array.ts:401
- returns
- Object | undefined
- The first object in the array
The first object in the array, or undefined
if the array is empty.
1 2 3 4 5 6 7 8 9 10 11 |
let vowels = ['a', 'e', 'i', 'o', 'u']; vowels.firstObject; // 'a' vowels.shiftObject(); vowels.firstObject; // 'e' vowels.reverseObjects(); vowels.firstObject; // 'u' vowels.clear(); vowels.firstObject; // undefined |
lastObject Object | undefined public
Inherited from EmberArray packages/@ember/-internals/runtime/lib/mixins/array.ts:426
- returns
- Object | undefined
- The last object in the array
The last object in the array, or undefined
if the array is empty.
length public
Inherited from EmberArray packages/@ember/-internals/runtime/lib/mixins/array.ts:319
Required. You must implement this method to apply this mixin.
Your array must support the length
property. Your replace methods should
set this property whenever it changes.