10. Array positions bug?


I don't understand what when wrong with my code it says "Oops. try again. Alas, you should have printed 31, as that is the fourth element!" but my code prints out 31 please help

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

console.log=(junkData [3]);


console.log=(junkData [3]);
This is your problem. Remove the "=" and just put


You need to print to console, you are not asking console.log to equal (=) the junkData :slightly_smiling:

ie. console.log(junkData[3]);


If you ran this code you also need to refresh the page because name = value assigns a value to a variable. Meaning that you replaced console.log with 31 and 31 is not a function. So after refreshing the page remove the = sign and try it again.