how loop array in javascript code example
Example 1: js loop array
let colors = ['red', 'green', 'blue'];
for (const color of colors){
console.log(color);
}
Example 2: how to use for loops to work with array in javascript
let myArray = ["one", "two", "three", "four"];