for of loop array javascript code example
Example 1: for of array javascript
let colors = ['red', 'green', 'blue'];
for (const color of colors){
console.log(color);
}
Example 2: javascript for of loop
for (variable of iterable) {
statement
}
Example 3: javascript for of loop
(function() {
for (const argument of arguments) {
console.log(argument);
}
})(1, 2, 3);
// 1
// 2
// 3