{"ScriptPreparationCode":"function generateTestData(size) {\r\n const items = Array.from({\r\n length: size\r\n }, (_, i) =\u003E ({\r\n id: i,\r\n name: \u0060Item ${i}\u0060\r\n }));\r\n\r\n // Randomly select ~75% of items\r\n const selectedItems = items\r\n .filter(() =\u003E Math.random() \u003E 0.25)\r\n .map(item =\u003E item.id);\r\n\r\n return {\r\n bill: {\r\n items\r\n },\r\n selectedItems\r\n };\r\n}\r\n\r\nconst dataSizes = [100, 1000, 10000, 100000, 1000000];\r\nvar data = generateTestData(Math.floor(Math.random() * 5));\r\n\r\nvar bill = data.bill;\r\nvar selectedItems = data.selectedItems;","TestCases":[{"Name":"Array.every Array.includes","Code":"const allSelected = bill.items.every(({ id }) =\u003E selectedItems.includes(id));\r\nreturn allSelected;","IsDeferred":false},{"Name":"Array.every Set.has with Set creation","Code":"const allSelected = ((selected) =\u003E \r\n bill.items.every(({ id }) =\u003E selected.has(id))\r\n )(new Set(selectedItems));\r\nreturn allSelected;","IsDeferred":false}]}