javascript for loop in an array code example
Example 1: for of array javascript
let colors = ['red', 'green', 'blue'];
for (const color of colors){
console.log(color);
}
Example 2: foreach javascript
arr.forEach(callback(currentValue [, index [, array]])[, thisArg]);