so I encountered weird problem here. I have an array status=new Array()
. Then I iterate from 0
to N-1
, and assign status[i]="idle";
I tried to do alert to check the values, and they are all assigned to a character coma ,
. Anyone knows what's wrong?
var status=new Array();
window.onload = function() {
for(var i=0;i<5;i++) {
status[i]="idle";
alert(status[i]);
}
}