Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

foreach javascript

let colors = ['red', 'blue', 'green'];
// idx and sourceArr optional; sourceArr == colors
colors.forEach(function(color, idx, sourceArr) {
	console.log(color, idx, sourceArr)
});
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #foreach #javascript
ADD COMMENT
Topic
Name
2+1 =