Creating Arrays

Creating Arrays

  • You can create that doesn’t initially contain any values, this is called an empty array

  • An array can also be created with initial values

  • Square brackets are a means of identifying if a variable is an array


Example

// declare a variable as an empty array
const numbers = []

// or you can declare an array with initial values
const streets = ['Broadway', 'Houston', 'Grand']

JS Bin on jsbin.com