Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
7 lines (4 sloc) 364 Bytes

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'];

Something went wrong with that request. Please try again.