I think it should alert 4 times, but why it just alerted just 2 times. Is there anyone can make an explanation for me?
var arr = new Array;
arr.push("1");
arr.push("2");
arr.push("3");
arr.push("4");
for(var i=0;i<arr.length;i++){
alert(arr.pop());
}