map (dependentKey, callback) Ember.ComputedProperty
public
Returns an array mapped via the callback
The callback method you provide should have the following signature. item
is the current item in the iteration. index
is the integer index of the current item in the iteration.
function(item, index);
Example
let Hamster = Ember.Object.extend({ excitingChores: Ember.computed.map('chores', function(chore, index) { return chore.toUpperCase() + '!'; }) }); let hamster = Hamster.create({ chores: ['clean', 'write more unit tests'] }); hamster.get('excitingChores'); // ['CLEAN!', 'WRITE MORE UNIT TESTS!']
Parameters:
-
dependentKey
String
-
callback
Function
Returns:
-
Ember.ComputedProperty
- an array mapped via the callback
Please login to continue.