JavaScriptSyntax
For...of Loop
Code example
for (const item of items) {
...
}Loops over the values of an array or iterable.
In JavaScript, for...of loop: loops over the values of an array or iterable — for (const item of items) { ... }
for (const item of items) {
...
}for (const item of items) {
...
}Loops over the values of an array or iterable.
Use for (const item of items) { ... }.
Use this pattern: for (const item of items) { ... }
Yes. Use Copy code and adapt the example to your program.
No. The language syntax is the same across operating systems.