javascript for let i of code example
Example 1: for of loop in es6
let colors = ['Red', 'Blue', 'Green'];
for (let color of colors){
console.log(color);
}
Example 2: how to use for of in javascript
const array1 = ['a', 'b', 'c'];
for (const element of array1) {
console.log(element);
}