This loop does basically the same thing, more than in Javascript-y:
for (var div = 1, radix = 16; div < 65536 * 65536; div *= radix) {
var piles = [];
for (var i = 0; i < a.length; ++i) {
var p = Math.floor(a[i] / div) % radix;
(piles[p] || (piles[p] = [])).push(a[i]);
}
for (var i = 0, ai = 0; i < piles.length; ++i) {
if (!piles[i]) continue;
for (var pi = 0; pi < piles[i].length; ++pi)
a[ai++] = piles[i][pi];
}
}
Instead of doing this as a C programmer, this loop creates a list of lists, one list for each possible 4-bit value. I avoid bit-shift operators because this is Javascript, and as long as they work, everything gets funny when numbers get large.
4 "a", "a" "", 4- . "", , 4 0, 1 .. (, , ). , , 4 .
, .
, . ; , , , , . , , , ( ) .