Array Review

Quick refresher on arrays:

  1. An array is created the same way as a variable

  2. Anything can go into an array by using []

  3. Each data value is paired with a key called an index.

  4. Values in the array can be accessed with their indexes using Array[index].

File Location

We will be working in the following file:

    javascript-library
        └── 0-PreWork
        └── 1-Fundamentals
            └── 1-Grammar-and-Types
            └── 2-ControlFlow-and-ErrorHandling
            └── 3-Loops
            └── 4-Functions
            └── 5-Expressions-and-Operators
            └── 6-Numbers-and-Dates
            └── 7-StringMethods
            └── 9-Arrays
                01-array-review.js <----You will be working in this file.

Practice

  1. Create an array of cars with 3 values, then print all three to the console.

  2. Create an array with multiple data-types and print each to the console.

  3. Several of the string methods will also work with arrays. Though we'll go further into detail on array methods later, play around with a few of them.

Last updated