--- id: bd7993c9c69feddfaeb8bdef title: Store Multiple Values in one Variable using JavaScript Arrays challengeType: 1 videoUrl: 'https://scrimba.com/c/crZQWAm' --- ## Description
With JavaScript array variables, we can store several pieces of data in one place. You start an array declaration with an opening square bracket, end it with a closing square bracket, and put a comma between each entry, like this: var sandwich = ["peanut butter", "jelly", "bread"].
## Instructions
Modify the new array myArray so that it contains both a string and a number (in that order). Hint
Refer to the example code in the text editor if you get stuck.
## Tests
```yml tests: - text: myArray should be an array. testString: assert(typeof myArray == 'object', 'myArray should be an array.'); - text: The first item in myArray should be a string. testString: assert(typeof myArray[0] !== 'undefined' && typeof myArray[0] == 'string', 'The first item in myArray should be a string.'); - text: The second item in myArray should be a number. testString: assert(typeof myArray[1] !== 'undefined' && typeof myArray[1] == 'number', 'The second item in myArray should be a number.'); ```
## Challenge Seed
```js // Example var ourArray = ["John", 23]; // Only change code below this line. var myArray = []; ```
### After Test
```js (function(z){return z;})(myArray); ```
## Solution
```js var myArray = ["The Answer", 42]; ```