On the current Google Chrome (Version 22.0.1229.79, on an iMac with Mountain Lion), the following code
var arr = [1, 3, 5];
console.log(arr);
delete arr[1];
console.log(arr);
console.log(arr.pop());
console.log(arr);
will show
[1, undefined × 2]
[1, undefined × 2]
5
[1, undefined × 1]
there are also other situation that caused Firefox to behave similarly as well. Are they bugs on Chrome and Firefox -- but it would seem strange that both Firefox and Chrome are susceptible to similar bugs -- or is it some behavior with array delete and console.log
? Supposedly, console.log
should not be running on a separate thread.