array.for js code example
Example 1: for of array javascript
let colors = ['red', 'green', 'blue'];
for (const color of colors){
console.log(color);
}
Example 2: for array javascript
let iterable = [10, 20, 30];
for (let value of iterable) {
value += 1;
console.log(value);
}
// 11
// 21
// 31