{"ScriptPreparationCode":null,"TestCases":[{"Name":"1000 event listeners","Code":"let i = 1001;\r\nconst results = [];\r\nwhile (--i) {\r\n const index = i;\r\n window.addEventListener(\u0027custom:test\u0027, () =\u003E {\r\n \tresults.push(index);\r\n }, {once: true});\r\n}\r\n\r\nwindow.dispatchEvent(new CustomEvent(\u0027custom:test\u0027));","IsDeferred":false},{"Name":"1 event listener handling an array of 1000 callbacks","Code":"let i = 1001;\r\nconst results = [];\r\nconst callbacks = [];\r\nwhile (--i) {\r\n const index = i;\r\n callbacks.push(() =\u003E {\r\n \tresults.push(index);\r\n })\r\n}\r\n\r\nwindow.addEventListener(\u0027custom:test\u0027, () =\u003E {\r\n callbacks.forEach((cb) =\u003E {\r\n cb()\r\n })\r\n}, {once: true});\r\n\r\nwindow.dispatchEvent(new CustomEvent(\u0027custom:test\u0027));","IsDeferred":false}]}