javascript array for i code example
Example 1: js loop array
let colors = ['red', 'green', 'blue'];
for (const color of colors){
console.log(color);
}
Example 2: javascript loop through array
const array1 = ['a', 'b', 'c'];
array1.forEach(element => console.log(element));