{"ScriptPreparationCode":"const first = new Set([...Array(10000)].map(it =\u003E String(~~(Math.random() * 10000))));\r\nconst second = new Set([...Array(10000)].map(it =\u003E String(~~(Math.random() * 200000))));\r\n\r\nclass MySet extends Set {\r\n intersection(other) {\r\n other.forEach((element) =\u003E {\r\n if (this.has(element)) {\r\n return;\r\n }\r\n this.delete(element);\r\n });\r\n return this;\r\n }\r\n}\r\n\r\nconst firstSet = new MySet(first);\r\nconst secondSet = new MySet(second);","TestCases":[{"Name":"Javascript Set Intersection","Code":"first.intersection(second)","IsDeferred":false},{"Name":"Set Intersection using has and delete","Code":"firstSet.intersection(second)","IsDeferred":false}]}