Question 10 not sure what is wrong here



when you initalize an arrray, you do so like this:

var junkData = []

and you cant call junkData[4] since there is no 4, the maximum is 3.


yh i just put 3 and still says the same thing


ok put 4.

and change this of your code

var junkData = ["eddie murphy", 49 , "peanuts", 31]

to this:

var junkData = []


why change it to that


still didn't work i cant be doing something wrong


since like i said in the post above thats how you initalize an array, for this specific array


yh and i put 3 and error is still coming up


ok i got it, delete the variables where you do var junkData[0] = "eddie", and so on.

And then your suppose to loop through array like this:

for(var i=3 ; i<=3 ; i++){

so dont do only console.log(junkData[4])


wooooow thank you i just realized i was doing for loops


Yea the topic it self is named introduction to for loops... ><