let x of y javascript code example
Example 1: for of loop in es6
let colors = ['Red', 'Blue', 'Green'];
for (let color of colors){
console.log(color);
}
Example 2: javascript for of loop
for (variable of iterable) {
statement
}
let colors = ['Red', 'Blue', 'Green'];
for (let color of colors){
console.log(color);
}
for (variable of iterable) {
statement
}