Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

use these instead of a for loop javascript

const array = [1, 2, 3];array.forEach(function(elem, index, array) {    array[index] = elem * 2;});console.log(array); // [2,4,6]
Source by medium.com #
 
PREVIOUS NEXT
Tagged: #loop #javascript
ADD COMMENT
Topic
Name
5+9 =