Store Multiple Values in one Variable using JavaScript- Arrays

What i do wrong

Your code so far

// Example
var ourArray = ["John", 23];

// Only change code below this line.
var myArray = ["peanut butter", "jelly", "bread"];
var myArray = [2,'j'];


Your browser information:

Your Browser User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36.

Link to the challenge:
https://www.freecodecamp.org/challenges/store-multiple-values-in-one-variable-using-javascript-arrays

Instructions
Modify the new array myArray so that it contains both a string and a number (in that order).

Notice bold part.

1 Like

can you show me hoe you do it???

No but, we can help guide you trough it.
in the example we know that
var sandwich = [“peanut butter”, “jelly”, “bread”]` .
and we are asked to put both an string and a number right?
we put a string with “” in it and a number without it
[“John”, 23]; is what we have

1 Like