javascript code to loop through array

JavaScript
let array = ["loop", "this", "array"]; // input array variable
for (let i = 0; i < array.length; i++) { // iteration over input
	console.log(array[i]); // logs the elements from the current input
}var colors = ["red","blue","green"];
for (var i = 0; i < colors.length; i++) {
    console.log(colors[i]);
}
Source

Also in JavaScript: