In order to duplicate an array in JavaScript: which of the following is faster to use?
###Slice method
var dup_array = original_array.slice();
<
As @Dan said "This answer becomes outdated fast. Use benchmarks to check the actual situation", there is one specific answer from jsperf that has not had an answer for itself: while:
var i = a.length;
while(i--) { b[i] = a[i]; }
had 960,589 ops/sec with the runnerup a.concat()
at 578,129 ops/sec, which is 60%.
This is the lastest Firefox (40) 64 bit.
@aleclarson created a new, more reliable benchmark.