9/13 Meet Arrays


#1



https://www.codecademy.com/en/courses/javascript-beginner-en-NhsaT/2/1?curriculum_id=506324b3a7dffd00020bf661#


I am getting an error message that says "Oops, try again. It looks like the third element in junk isn't a number."
I thought it might be because I chose a negative number... making it positive doesn't help. I've tried to check my syntax and can't find an issue. Even with minor tweaks like spacing, same result.

Thanks for your time!


var junk = ["Lettuce","Dirty Diapers","-573","222"]; {
    console.log (junk)
}


#2

lets have a look at the following code:

var junk = ["Lettuce","Dirty Diapers","-573","222"];
console.log(typeof(junk[2]))

typeof isn't covered yet, in simple terms, it will tell you the data type (string, integer, float, Boolean and so on), as you can see, your third list item is a string

If you want to use numbers, use them without quotation marks ", numbers can be stored as string, but then they aren't numbers


#3

Thank you so much. I'll try to remember that numbers don't need quotations.