Javascript array of strings

so I ran into this strange problem. I have an array status=new Array(). Then I repeat from 0to N-1and assign. status[i]="idle";I tried to give a warning to check the values, and they are all assigned to the coma symbol ,. Does anyone know what happened?

var status=new Array();
window.onload = function() {
    for(var i=0;i<5;i++) {
        status[i]="idle";
        alert(status[i]);
    }
}
+3
source share
1 answer

(, , ). window.status , , , - ( , , - ). var window, window.status .

() ( , Chrome) (source) .

, . Firefox . , Firefox window.status, Chrome .

+7

All Articles