Why global variables in JavaScript are always init with rubbish inside?

JavaScript enviroment inconsistancy.

var eulerPath = [];

var crackSafe = function(n, k) {

    console.log(eulerPath);
}

so locally it prints empty array as you would expect but when you submit it has like ['0','']. Same with {}, when you run localy it's an emplty object as you would expect but after submit it filled with {'0': null}.
It should be empty by specification,
Please fix that!

Comments (2)