Section 1 - Instruction

Last time, we saw how arrays like let planets = ["Mercury", "Venus", "Earth"];

can hold multiple values together in order.

But how do we get just one specific item out of the array, like "Venus"?

Engagement Message

Any ideas on how we might pinpoint an item?

Section 2 - Instruction

Each item in an array has a specific position, called an index. Think of it like a numbered slot.

JavaScript starts numbering these positions from zero, not one! This is called zero-based indexing.

Engagement Message

So, what index number do you think the first item in an array has?

Section 3 - Instruction

That's right, the first item is at index 0. The second item is at index 1, the third at index 2, and so on.

To access an item, you use the array variable followed by the index in square brackets [].

Engagement Message

If we have ["Mercury", "Venus", "Earth"], what value does planets[0] give?

Section 4 - Instruction

Using our planets array: planets[0] gives , gives , etc.

Sign up
Join the 1M+ learners on CodeSignal
Be a part of our community of 1M+ users who develop and demonstrate their skills on CodeSignal