hands-on lab

Working with JavaScript Arrays

Difficulty: Beginner
Duration: Up to 40 minutes
Students: 1,055
Rating: 3.5/5
Get guided in a real environmentPractice with a step-by-step scenario in a real, provisioned environment.
Learn and validateUse validations to check your solutions every step of the way.
See resultsTrack your knowledge and monitor your progress.

Description

In this lab, you will be working with JavaScript arrays. Arrays are zero-indexed data collections with many built-in methods. These methods help you access and manipulate the values (elements) of an array.

You will declare an array and use built-in methods to access and add values to the array. Each check will ask you to output the current value of the array to the console.

Learning Objectives

Upon completion of this lab, you will be able to:

  • Declare a JavaScript Array
  • Access the value of an array at a specific index
  • Use .push(), .length, and .splice() methods

Intended Audience

  • Beginners learning front-end development
  • Software Engineers who need to learn front-end technologies to expand their skillset

Prerequisites

The following courses/courses and labs can ensure your success:

Covered topics

Lab steps

Introduction to JavaScript Labs
Declare an array
Array value at specific index
Push a value to an array
Console log the array length
Splice an array