filmov
tv
What are Iterables and Array like Objects JavaScript

Показать описание
Iterables
Story: "The Loop That Broke the Internet"
You’ve written for (int i = 0; ...) in Java. In JavaScript, loops are more versatile:
const arr = [10, 20, 30];
for (const num of arr) { // for...of for arrays
}
But don’t confuse for...of (values) with for...in (indexes/keys)!
Key Concepts:
Story: "The Loop That Broke the Internet"
You’ve written for (int i = 0; ...) in Java. In JavaScript, loops are more versatile:
const arr = [10, 20, 30];
for (const num of arr) { // for...of for arrays
}
But don’t confuse for...of (values) with for...in (indexes/keys)!
Key Concepts: