there are two different ways to copy a array, using Array.concat or Array.slice,
var a = [1, 2, 3], c1 = .concat(a), c2 = a.slice(0);
which way is better?
For clarity, you should use the method that is the documented method of taking a copy of an array (or portion thereof):
var c2 = a.slice(0);
On any decent browser the performance difference will be negligible, so clarity should be the deciding factor.
In terms of performance, the difference between the two options are minimal, according to a jsperf.com test.
©2020 All rights reserved.