Introduction and Lesson Objectives

Hello, future JavaScript star! Today, we're delving into the world of Lists and Arrays, in JavaScript. A list, much like a drawer, holds numerous values within a single container. By the end of this lesson, we will have mastered the essential tactics for efficiently crafting, accessing, and manipulating JavaScript lists.

Defining Lists: The Basics

Think of a list, or array, as a fleet of spaceships, where each ship carries a distinct item. So, you may ask, how does one assemble this space fleet? There are two methods:

  • Using the array constructor new Array():
  • Using brackets []:

Both techniques swiftly create a list, so feel free to choose the one you prefer!

Navigating with Indexing

Indexes in lists are akin to celestial coordinates. Each item in a list has an index that starts from 0 — this is specific to JavaScript.

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