Skip to content
dreamcode
dreamcode
Map
Arrays
Lesson 15 of 48
+15 XP on finish
JAVASCRIPT CLIMBSChapter 3 · JS Collections & Loops

Array lists

JavaScript arrays are list-like objects used to store multiple values. They are zero-indexed and support built-in helper functions like .push() and .length.

Worked example

How it reads

  • ["cirrus", "stratus"] declares an array of two strings.
  • clouds.length gets the number of elements in the array.
Cloud tip: You can add elements to the end of an array using the .push(value) method.
index.js
JAVASCRIPT
real JavaScript, runs in your browser
Console
Run your code to see its output here.
YOUR TURN

Log the last cloud using sky.length - 1, then remove it with pop() and log the array: neon then [ 'puffy', 'grey' ].

Press Run to check your work.