Your files never leave your device
Advertisement

Arrays & Array Methods

Arrays are ordered lists of data. They let you group multiple values into a single variable.

Creating and Accessing Arrays

Arrays are zero-indexed, meaning the first item is at position 0.

Try It Yourself

        

Modifying Arrays

You can add and remove items using built-in methods like push() (add to end) and pop() (remove from end).

Try It Yourself

        

Practice

Challenge 1: Create an array of three numbers, add a fourth number using push, then log the array.

Related Guides

Sponsored Utility
While You're Here
Sponsored Recommendations
Advertisement