Tell us what’s happening:
Describe your issue in detail here.
why dose it keep saying that the second one in string should be a number, it is.
Your code so far
// Only change code below this line
const myArray = ["i am", "23"];
Your browser information:
User Agent is: Mozilla/5.0 (X11; CrOS x86_64 14816.131.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36
Challenge: Basic JavaScript - Store Multiple Values in one Variable using JavaScript Arrays
Link to the challenge:
When you put quotes around it then that makes it a string, even if that string is a number. A number in JS has no quotes, just the number itself.
1 Like
yeah thanks i figured that as soon as i wrote the msg. thanks tho for reply.
I’ve tried that I can think of?
I keep getting a syntax error when I try to create a string so it won’t even let the code run. I’ve written all the basic ways I think it should work… Anyone?
A picture is not the best way to share code. But from the looks of it you are not using normal single '
or double "
quotes. If this is from you typing on your keyboard you may need to change some setting. Also i know that if i copy and paste words from a site that have stylized “quotes” for the left and right side that javascript is not a fan of it will give that error.