Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how the map function works javascript

const array = [2, 5, 9];
let squares = array.map((num) => num * num);

console.log(array); // [2, 5, 9]
console.log(squares); // [4, 25, 81]
Source by www.codecademy.com #
 
PREVIOUS NEXT
Tagged: #map #function #works #javascript
ADD COMMENT
Topic
Name
1+3 =