Class MutableArray
publicUses: | MutableEnumerable , | EmberArray
---|---|
Defined in: | packages/@ember/-internals/runtime/lib/mixins/array.js:1527 |
Module: | @ember/array |
[] public
Module: | @ember/array |
---|
Inherited from EmberArray packages/@ember/-internals/runtime/lib/mixins/array.js:278
- 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.
let peopleToMoon = ['Armstrong', 'Aldrin']; peopleToMoon.get('[]'); // ['Armstrong', 'Aldrin'] peopleToMoon.set('[]', ['Collins']); // ['Collins'] peopleToMoon.get('[]'); // ['Collins']
firstObject Object | undefined public
Module: | @ember/array |
---|
Inherited from EmberArray packages/@ember/-internals/runtime/lib/mixins/array.js:306
- returns
- Object | undefined
- The first object in the array
The first object in the array, or undefined
if the array is empty.
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
hasArrayObservers public
Module: | @ember/array |
---|
Inherited from EmberArray packages/@ember/-internals/runtime/lib/mixins/array.js:552
Becomes true whenever the array currently has observers watching changes on the array.
let arr = [1, 2, 3, 4, 5]; arr.hasArrayObservers; // false arr.addArrayObserver(this, { willChange() { console.log('willChange'); } }); arr.hasArrayObservers; // true
lastObject Object | undefined public
Module: | @ember/array |
---|
Inherited from EmberArray packages/@ember/-internals/runtime/lib/mixins/array.js:331
- returns
- Object | undefined
- The last object in the array
The last object in the array, or undefined
if the array is empty.
length public
Module: | @ember/array |
---|
Inherited from EmberArray packages/@ember/-internals/runtime/lib/mixins/array.js:224
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.
© 2020 Yehuda Katz, Tom Dale and Ember.js contributors
Licensed under the MIT License.
https://api.emberjs.com/ember/3.25/classes/MutableArray/properties