LESSON 36 OF 50

Read an element by index

Access the second element of an array.

Official sourceECMAScript — Array objectsReviewed: 2026-08-26
STEP 1 · LEARN

How it works

Array indices start at 0. Therefore, the second element is read with index 1.

Correct example
const services = ['Design', 'Dezvoltare', 'SEO'];
const second = services[1];
console.log(second);

Index 1 points to “Dezvoltare”.

Common mistake
const second = 'Dezvoltare';
console.log(second);

The value is copied manually rather than read from the array.

STEP 2 · APPLY

Your exercise

Store services[1] in second and print the variable.

STEP 3 · RUN

Write and run the code

script.jsJAVASCRIPT
Isolated consoleisolated
Preparing the runtime…
Run the code to see the result.
The draft stays only in this browser.Isolated QuickJS · no DOM, session or network
STEP 4 · CHECK

What needs to pass

0%not checked
  • services stores the three elements.
  • second receives services[1].
  • The output is exactly Dezvoltare.
Explain the solution logic

Indexed access reads the actual value from the second collection position.