for Loop
JS · Control Flowfor (init; condition; update) { ... }const items = ["apple", "banana", "cherry"];
for (let i = 0; i < items.length; i++) {
console.log(`${i + 1}. ${items[i]}`);
}"1. apple"
"2. banana"
"3. cherry"Note Classic loop when you need the index. For simple iteration, prefer for...of. Cache .length in the initializer if the array is very large and not changing.