Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
Check out the new SourceForge HTML5 internet speed test! No Flash necessary and runs on all devices. ×

Comment Re:I dunno... (Score 1) 776

This differs depending on which browser you're writing for. On my version of Firefox, this is the most efficient:

var array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
var length = array.length;
for (length -= 2; length > -1; length -= 1)
{
array.push(array[length]);
array.splice(length, 1);
}

This is according to http://jsperf.com/js-array-reverse-vs-while-loop/5

Slashdot Top Deals

As in certain cults it is possible to kill a process if you know its true name. -- Ken Thompson and Dennis M. Ritchie

Working...