Using Array.map for Complex Transformations in Javascript


Transform elements in an array into a new array of different values.

Source Code

let numbers = [1, 2, 3];
let squared = numbers.map(number => number * number);
console.log(squared);
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments