Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js map()

var number = [1, 2 , 3, 4, 5, 6, 7, 8, 9]; 
var doubles  = number.map((n) => { return n*2 })

/*  doubles 
    (9) [2, 4, 6, 8, 10, 12, 14, 16, 18] */
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #js
ADD COMMENT
Topic
Name
4+2 =