Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

map javascript

var numbers = [1, 4, 9];
var doubles = numbers.map(function(num) {
  return num * 2;
});
// doubles é agora [2, 8, 18]. numbers ainda é [1, 4, 9]
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #map #javascript
ADD COMMENT
Topic
Name
1+4 =