map() Array Method in Javascript
var drinks = [“coffee soda”, “tea”, “whiskey”];
var coldDrinks = drinks.map(function(drink) {
return ‘iced ’ + drink;
});
// [‘iced coffee soda’, ‘iced coffee’, ‘iced whiskey’]
Are there any code examples left?
New code examples in category Other