// generate an array of 1000 elements
var a = new Array(1000).join(",.").split(","),
calls = 0;
// call sort method incrementing the conter
// return zero, nothing should change
// discover the monster
Guess how many times Internet Explorer compare results? 17583 times, against a.length - 1 in other browsers.
Nice stuff guys, I guess for big arrays a manual reimplementation could perform better, am I wrong?