Array Positions


I have the code below listed, the call is showing a result of 31 being printed, but it continues to tell me Oops, try again. Alas, you should have printed 31, as that is the 4th element!.

var junkData = ["Eddie Murphy", 49, "peanuts", 31];
console.log = (junkData[3]);


you don't need = sign for console.log.

after changing it refresh your browser :slight_smile:


Hi , I also have a problem i ahve done this

var junkData = ["Eddie Murphy", 49, "peanuts", 31];
junkData = [0,1,2,3];

and i got number 3, not 31? is that correct or I dont know where i am making mistake


It is because you replaced the elements of junkData.

junkData = [0,1,2,3];

why did you create this?now the first element of junkData is 0 not "Eddie Murphy"


I have nnotice that, you are right. is ok...


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