10. Array Positions


Hello! I'm having a problem with the excersize Array Positions.
my code looks like this:

var junkData = ["Eddie Murphy", 49, "peanuts", 31];

and the console prints 31, but i get the feedback "Oops, try again. Alas, you should have printed 31, as that is the 4th element!"

after searching around the fora i also tried the following code:

var junkData = ["Eddie Murphy", 49, "peanuts", 31];

but that gives the feedback "TypeError: console.log is not a function"


Well name = value means that you assign a value to a variable so because of this statement:


console.log is not longer the function that prints stuff to the console but the value 31 which is stored in junkData[3]. To fix this you need to refresh the page to reset the javaScript.


Thank you very much, that worked!! I didn't know that this could mess with the code that much