for (let element of array) code example
Example 1: for array javascript
let iterable = [10, 20, 30];
for (let value of iterable) {
value += 1;
console.log(value);
}
// 11
// 21
// 31
Example 2: for of loop in es6
let colors = ['Red', 'Blue', 'Green'];
for (let color of colors){
console.log(color);
}
Example 3: es6 for-of loop
for (let itme of list) {
...
}