Codecademy

Sign In Create Account
01/07
Multi-whats?

The plain old arrays we've been talking about can store just about anything. We've been using them to create lists of strings so far, but that's just the tip of the iceberg.

You can put any javascript data type in an array. That includes strings, numbers, objects, functions, and even other arrays!

The following is a perfectly valid array:
var myArray = ["hello", 45, [1,2,3,4] ];

Woah! The first item is a string and the second is a number, but the last one is an array.

Imagine we have 2 players in a game of poker. How would we store the value of each player's hand in an array. Complete the code to find out.

Save & Submit Code Reset Code
Back to editor

Start Here

Each lesson starts here. Read the explanation, then follow the instructions underneath. If you get stuck, you can click on the "Hint" for help.

Enter your Code

Type your response to the instructions here, in your code editor.

Submit!

Ready to see if your code does what it should? Click "Save + Submit" to run and check your code!

Click "Save + Submit" to run your code! Your code’s output will pop up on the screen.

See What it Does

This is the terminal. When you submit your code, it will run your code and display the result here.

Sign in to Codecademy