scrimba
Learn JavaScript loops and iteration
forEach: reaching its limits
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

forEach: reaching its limits
AboutCommentsNotes
forEach: reaching its limits
Expand for more info
index.js
run
preview
console
/* Example: foreach loops */
let clothes = ["top", "dirty underwear", "bottoms", "shoes", "socks"]

let doWashing = false
let clothesToWash = []
Console
"0"
,
"top"
,
"New array is: top,bottoms,shoes,socks,underwear"
,
"1"
,
"dirty underwear"
,
"2"
,
"shoes"
,
"3"
,
"socks"
,
"4"
,
"underwear"
,
"Clothes to wash: dirty underwear"
,
/index.html
-6:22