The for...of
statement is used to iterate over the values of iterable objects (like arrays, strings, maps, etc.) in JavaScript. It provides a simpler syntax than traditional loops and works well with iterables.
Example:
let arr = [10, 20, 30];
for (let value of arr) {
console.log(value);
}
// Output: 10 20 30
Tags: intermediate, JavaScript, Loops