Menu

Toshimaru's Blog

Loop each character in string using JavaScript

Code

Use for..of to loop through string in JavaScript.

for (const s of 'Hello World!') { console.log(s) }

Output

H
e
l
l
o

W
o
r
l
d
!

See also

Load more