{"ScriptPreparationCode":"const array = [\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n { foo: \u0027bar\u0027 },\r\n];","TestCases":[{"Name":"Create a copy using the spread operator","Code":"const newArray = [...array, { foo: \u0027bar\u0027 }];","IsDeferred":false},{"Name":"Create a copy using array.concat","Code":"const newArray = array.concat({ foo: \u0027bar\u0027 });","IsDeferred":false},{"Name":"Create a copy manually in a loop using push","Code":"const newArray = [];\r\nconst len = array.length;\r\nfor (let i = 0; i \u003C len; i\u002B\u002B) {\r\n newArray.push(array[i]);\r\n}\r\nnewArray.push({ foo: \u0027bar\u0027 });","IsDeferred":false},{"Name":"Create a copy manually in a loop by index","Code":"const len = array.length;\r\nconst newArray = new Array(len \u002B 1);\r\nfor (let i = 0; i \u003C len; i\u002B\u002B) {\r\n newArray[i] = array[i];\r\n}\r\nnewArray[len] = { foo: \u0027bar\u0027 };","IsDeferred":false}]}