Answers for "mdn .map"

5

array mdn map

let new_array = arr.map(function callback( currentValue[, index[, array]]) {
    // return element for new_array
}[, thisArg])
Posted by: Guest on June-15-2020
0

mdn .map

const numbers = [1, 5, 10, 15];
const doubles = numbers.map(function(x) {
   return x * 2;
});
// doubles is now [2, 10, 20, 30]
// numbers is still [1, 5, 10, 15]
Posted by: Guest on October-09-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language