freeCodeCamp/guide/english/javascript/tutorials/store-multiple-values-in-on.../index.md

10 lines
372 B
Markdown
Raw Normal View History

2018-10-12 19:37:13 +00:00
---
title: 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'];`