Question 10 not sure what is wrong here


#1


#2

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.


#3

yh i just put 3 and still says the same thing


#4

ok put 4.

and change this of your code

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

to this:

var junkData = []

#5

why change it to that


#6

still didn't work i cant be doing something wrong


#7

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


#8

yh and i put 3 and error is still coming up


#9

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++){
 console.log(junkData[3])   
}

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


#10

wooooow thank you i just realized i was doing for loops


#11

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