Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

JavaScript Map Function

const myAwesomeArray = [5, 4, 3, 2, 1]

myAwesomeArray.map(x => x * x)

// >>>>>>>>>>>>>>>>> Output: [25, 16, 9, 4, 1]
Source by www.freecodecamp.org #
 
PREVIOUS NEXT
Tagged: #JavaScript #Map #Function
ADD COMMENT
Topic
Name
1+8 =