{"ScriptPreparationCode":"const SET_SIZE = 1000;\r\n\r\nvar set1 = new Set()\r\nvar set2 = new Set()\r\nwhile (i \u003C SET_SIZE) {\r\n const nid = \u0027key:\u0027\u002BMath.random();\r\n set1.add(nid);\r\n if (i % 2 == 0) set2.add(nid);\r\n i\u002B\u002B;\r\n}\r\nwhile (i \u003C SET_SIZE / 2) {\r\n set2.add(\u0027key:\u0027\u002BMath.random());\r\n}","TestCases":[{"Name":"Spreading","Code":"const set3 = new Set([...set1, ...set2]);\r\nconsole.log(set3.size)","IsDeferred":false},{"Name":"Set.forEach \u002B Set.add","Code":"const set3 = new Set(set1);\r\nset2.forEach(el =\u003E set3.add(el));\r\nconsole.log(set3.size)","IsDeferred":false},{"Name":"Generators","Code":"const set3 = new Set(function*() { yield* set1; yield* set2; }());\r\nconsole.log(set3.size)","IsDeferred":false}]}