Answers for "how to write a map array to a method in javascript"

7

how to use the map method in javascript

const numbers = [1, 2, 3, 4, 5]; 

const bigNumbers = numbers.map(number => {
  return number * 10;
});
Posted by: Guest on April-08-2020
-3

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’]
Posted by: Guest on July-01-2021

Code answers related to "how to write a map array to a method in javascript"

Browse Popular Code Answers by Language