Can a for of loop iterate through a string and not an array 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
const numbers = [1,2,3,4];
for(const item of numbers){
console.log(item);
}