I print out the fourth array [3] but get an error


I get the error

Oops, try again. Alas, you should have printed 31, as that is the 4th element!

But 31 is the 4th element of the array, I'm confused.

Replace this line with your code.


Please post your code so we can help you :slight_smile:


Hi Bandit,

Here it is.

// Practice array!

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

console.log = junkData[3];


You need to have your console.log in () so for example:

console.log(junkData[3]) //add those parentheses!


Thank's that has now accepted the code.


Good glad to help! :smiley: And thanks to @bandit you posted your code so we could solve the problem!


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.