Array positions


#1

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

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

whats wrong with this code i am doing doing right


#2

@fahadshah
This junkData[3] should be inside of your console.log()
and not outside....

With console.log(junkData) you are presenting the whole of the Array


#3

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