Wherein lies the secret to looping like a pro?
Here, we'll dive into the depths of Forever Loops, where the loop never ends.
For loops: the most common form of loop, where you loop over an iterable like a fish in a barrel.
for (let fish in fishTank) {
console.log(fish.name);
}
Where the loop never ends... or does it?
for (let i = 0; i < 10 ** 100; i++) {
console.log(i);
// This will never end...
}
Want more examples? Check out our For-Loop Examples page for more fishy fun!