{"ScriptPreparationCode":"const N = 80_000;\r\nconst DATA = Array.from({ length: N }, (_, i) =\u003E ({\r\n id: i,\r\n active: (i \u0026 1) === 0, // half active\r\n score: (i * 7) % 100, // 0..99\r\n group: (i % 25), // 25 groups\r\n name: \u0022user_\u0022 \u002B i,\r\n tags: [i % 5, i % 7, i % 11],\r\n}));\r\nwindow.DATA = DATA;\r\n\r\n// ---- Remeda loader: attach to window.Rm (avoids clash with Ramda\u0027s R)\r\nwindow.RmReady = (async () =\u003E {\r\n if (!window.Rm) {\r\n const m = await import(\u0027https://esm.sh/remeda@2\u0027);\r\n // Expose the namespace under \u0027Rm\u0027 to avoid \u0027R\u0027 collision with Ramda\r\n window.Rm = m;\r\n }\r\n})();","TestCases":[{"Name":"Lodash","Code":"const res = _(DATA)\r\n .filter(u =\u003E u.active \u0026\u0026 u.score \u003E 50)\r\n .groupBy(\u0027group\u0027)\r\n .mapValues(arr =\u003E _.sumBy(arr, \u0027score\u0027))\r\n .value();\r\n","IsDeferred":false},{"Name":"Ramda","Code":"// R.pipe is available globally from ramda\r\nconst res = R.pipe(\r\n R.filter(u =\u003E u.active \u0026\u0026 u.score \u003E 50),\r\n R.groupBy(u =\u003E String(u.group)),\r\n R.map(arr =\u003E R.sum(R.pluck(\u0027score\u0027, arr)))\r\n)(DATA);\r\n","IsDeferred":false},{"Name":"Remeda","Code":"// Ensure Remeda is present\r\nif (!window.Rm) throw new Error(\u0022Remeda not loaded\u0022);\r\n// Use Rm.pipe to avoid clashing with Ramda\u0027s R\r\nconst Rm = window.Rm;\r\nconst res = Rm.pipe(\r\n DATA,\r\n Rm.filter(u =\u003E u.active \u0026\u0026 u.score \u003E 50),\r\n Rm.groupBy(u =\u003E String(u.group)),\r\n Rm.mapValues(arr =\u003E Rm.sumBy(arr, x =\u003E x.score))\r\n);\r\n","IsDeferred":false}]}