Answers for "loop thorugh array js"

18

loop array javascript

var colors = ['red', 'green', 'blue'];
	
	colors.forEach((color, colorIndex) => {
     console.log(colorIndex + ". " + color); 
    });
Posted by: Guest on April-08-2020
2

javascript best way to loop through array

var len = arr.length;
while (len--) {
    // blah blah
}
Posted by: Guest on March-25-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language