Skip to main content

2 docs tagged with "loops"

View all tags

Loops

How to choose between forEach / map / filter / reduce and the difference between for...of and for...in. Explains array-processing best practices that make intent clear with higher-order functions, using Bad / Good comparisons.

Loops

An explanation of how to write and choose between for / while / do-while / for...of / for...in. Covers break and continue, getting the index with entries(), and the reason you shouldn't use for...in on arrays, all in a beginner-friendly way.