Loop JavaScript através da string
for (var i = 0; i < str.length; i++) {
console.log(str.charAt(i));
}
TC5550
for (var i = 0; i < str.length; i++) {
console.log(str.charAt(i));
}
// for... in
for (let i in str) {
console.log(str[i]);
}
const str = "Hello Grepper!";
const chars = [...str];
chars.forEach((c, i) => console.log(c, i));