{"ScriptPreparationCode":"var origNumItems = 1000000; // 1 million\r\nvar newNumItems = origNumItems * 2;\r\nvar origArr = [];\r\nvar newItems = [];\r\n\r\nfunction initArray(arr, numItems) {\r\n for (var i = 0; i \u003C= numItems; i\u002B\u002B) { arr.push(\u0060Item ${i}\u0060); }\r\n}\r\n\r\ninitArray(origArr, origNumItems);\r\ninitArray(newItems, newNumItems);\r\n","TestCases":[{"Name":"Set","Code":"var s = new Set(origArr);\r\n\r\nfor (const i in newItems) {\r\n s.add(i);\r\n}\r\nArray.from(s);","IsDeferred":false},{"Name":"Object","Code":"var obj = {};\r\nfor (const i in origArr) {\r\n obj[i] = true;\r\n}\r\n\r\nfor (const i in newItems) {\r\n obj[i] = true;\r\n}\r\n_.keys(obj)","IsDeferred":false},{"Name":"Lodash union","Code":"// Creating this duplicate array is needed to emulate creating the data structure that contains the new items,\r\n// which the other tests do by creating an object or set\r\nvar newArr = [];\r\nfor (const i in newItems) {\r\n newArr.push(i);\r\n}\r\n\r\n_.union(origArr, newArr)","IsDeferred":false}]}