Skip to content

Challenge Store Multiple Values In One Variable Using JavaScript Arrays

Quincy Larson edited this page Aug 20, 2016 · 1 revision

Challenge Store Multiple Values in one Variable using JavaScript Arrays

With JavaScript array variables, we can store several pieces of data in one place.

You start an array declaration with an opening bracket, end it with a closing bracket, and put a comma between each entry, like this:

var sandwich = ["peanut butter", "jelly", "bread"]

myArray = [2,'j'];

Clone this wiki locally