{"ScriptPreparationCode":"const MULTIPLIER = 5000\r\n\r\nvar ramdaCount = R.pipe(\r\n R.map(R.o(Math.round, R.multiply(MULTIPLIER))),\r\n R.filter(R.modulo(R.__, 2)),\r\n R.countBy(R.identity)\r\n)\r\n\r\nvar ramdaConcatTimes = R.map(R.o(R.concat(R.__, \u0027 times\u0027), String))\r\n\r\nvar nativeCount = vals =\u003E \r\n vals\r\n \t.map(v =\u003E Math.round(v * MULTIPLIER))\r\n \t.filter(v =\u003E v % 2)\r\n \t.reduce((acc, cur) =\u003E { acc[cur] = (acc[cur] | 0) \u002B 1; return acc }, {})\r\n\r\nvar nativeConcatTimes = counts =\u003E \r\n\tObject\r\n\t\t.keys(counts)\r\n\t\t.reduce((acc, key) =\u003E { acc[key] = String(counts[key]) \u002B \u0027 times\u0027; return acc }, {})\r\n\r\nvar nativeConcatTimesUsingEntries = counts =\u003E \r\n\tObject.fromEntries(\r\n\t\tObject\r\n\t\t\t.entries(counts)\r\n \t\t.map(([key, val]) =\u003E [key, String(val) \u002B \u0027 times\u0027])\r\n )\r\n\r\nvar arr = Array.from({length: 10000}, Math.random)\r\n\r\nconst ramdaRes = ramdaConcatTimes(ramdaCount(arr))\r\nconst nativeRes = nativeConcatTimes(nativeCount(arr))\r\nconst otherNativeRes = nativeConcatTimesUsingEntries(nativeCount(arr))\r\n\r\nif (!R.equals(ramdaRes, nativeRes) || !R.equals(nativeRes, otherNativeRes)) {\r\n throw new Error(\u0027different results\u0027)\r\n}","TestCases":[{"Name":"Ramda - Count","Code":"ramdaCount(arr)","IsDeferred":false},{"Name":"Native - Count","Code":"nativeCount(arr)","IsDeferred":false},{"Name":"Ramda - Count and map object","Code":"R.o(ramdaConcatTimes, ramdaCount)(arr)","IsDeferred":false},{"Name":"Native - Count and map object","Code":"nativeConcatTimes(nativeCount(arr))","IsDeferred":false},{"Name":"Native - Count and map object using entries","Code":"nativeConcatTimesUsingEntries(nativeCount(arr))","IsDeferred":false}]}