+ 3
given the array below ,please complete the expression to be alerted with "apple"?
var frutis=new Array ("pear","orange ","apple","grapefruti"); alert (frutis---);
7 Respostas
+ 4
var fruits = new Array("pear", "orange",
"apple", "grapefruit");
alert(fruits
[2]
);
+ 3
alert (fruitis [2])
+ 1
[2]
Trust me..
+ 1
var fruits = new Array("pear", "orange",
"apple", "grapefruit");
alert(fruits
[2]
);
This is the output
+ 1
can anyone explain why 2?
0
2 because indices start from 0 and when you count it is on the second index
0
var fruits = new Array("pear", "orange",
"apple", "grapefruit");
alert(fruits
[2]
);