Test case details

Preparation Code

var data = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

Test cases

Test #1

var copy = [] for (var j = 0, jmax = data.length; j < jmax; j++) copy.push(data[j]);

Test #2

var copy = data.slice(0);

Test #3

var copy = new Array(data.length); for (var j = 0, jmax = data.length; j < jmax; j++) copy[j] = data[j];

Test #4

var i = data.length, copy = new Array(i); while (i--) copy[i] = data[i];

Test #5

var copy = data.concat([]);