Skip to content
Make room for learningYour learning studio
Visit every item4 min

Loading your session…

A small idea, worth understanding

Visit every item

Trace a foreach loop over values.

foreach visits each item of an array. The variable after as holds the current value.

You can also use key => value to inspect both parts of each entry.

Two activities. No typing needed. You can always retry, or read an explanation and continue.

Read the full lesson first