>_BeginnerCoder
Donate

Lesson 5 — Arrays

Arrays

An array is an ordered list of values in square brackets. push() adds to the end, and methods like forEach and map walk through every item.

Why it matters: arrays hold collections — prices, users, messages — that you loop over to build almost any feature.

Tip: indexes start at 0, so nums[0] is the first element and nums.length is how many there are.

Task

Add 40 and log the sum.

← Back
Next →

Enjoying this lesson? Share it 👇

Keep going with JavaScript Foundations

Ready for more? These paid resources pick up where this lesson leaves off.

Some links on this page are affiliate links: we may earn a commission at no extra cost to you. We only recommend tools we believe are genuinely useful.