Que estoy haciendo mal?

Tell us what’s happening:

Someone tells me that I am doing wrong with the code because I put number which is the second and I get throwing an error that the second element of myArray must be number I put it in different ways but still it is not validating it for me

Your code so far


// Only change code below this line
var myArray = [ "string"];
var myArray =  ["number"];

Your browser information:

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

Challenge: Store Multiple Values in one Variable using JavaScript Arrays

Link to the challenge:

You need to add two values to the myArray array, the first should be of type String, the other of type Number.

const someArray = ['this is a string', 42];

1 Like