{"ScriptPreparationCode":"var data = _.range(100000).map(function(i) {\r\n return {\r\n counter: i\r\n }\r\n});\r\n\r\nfunction isOdd(num) {\r\n return num % 2 === 1;\r\n}\r\n\r\nfunction square(num) {\r\n return num * num;\r\n}\r\n\r\nfunction lessThanThreeDigits(num) {\r\n return num.toString().length \u003C 3;\r\n}","TestCases":[{"Name":"JS native","Code":"var result = data\r\n .map(({counter}) =\u003E counter)\r\n .filter(isOdd)\r\n .map(square)\r\n .filter(lessThanThreeDigits)","IsDeferred":false},{"Name":"Ramda with transducer","Code":"var transducer = R.compose (\r\n R.map(R.prop(\u0027counter\u0027)),\r\n R.filter(isOdd),\r\n R.map(square),\r\n R.filter(lessThanThreeDigits),\r\n);\r\n\r\nvar result = R.transduce (\r\n transducer,\r\n (acc, val) =\u003E {\r\n acc.push(val);\r\n return acc;\r\n },\r\n [],\r\n data,\r\n);","IsDeferred":false},{"Name":"Ramda with transducer (no prop)","Code":"var transducer = R.compose (\r\n R.map(({counter}) =\u003E counter),\r\n R.filter(isOdd),\r\n R.map(square),\r\n R.filter(lessThanThreeDigits),\r\n);\r\n\r\nvar result = R.transduce (\r\n transducer,\r\n (acc, val) =\u003E {\r\n acc.push(val);\r\n return acc;\r\n },\r\n [],\r\n data,\r\n);","IsDeferred":false},{"Name":"Ramda with currying and composition","Code":"var result = R.pipe(\r\n R.pluck(\u0027counter\u0027),\r\n R.filter(isOdd),\r\n R.map(square),\r\n R.filter(lessThanThreeDigits)\r\n)(data);","IsDeferred":false},{"Name":"Ramda without relying on currying or composition","Code":"var result = R.filter(lessThanThreeDigits,\r\n R.map(square,\r\n R.filter(isOdd,\r\n R.pluck(\u0027counter\u0027, data))));","IsDeferred":false},{"Name":"Ramda with currying and composition (no pluck)","Code":"var result = R.pipe(\r\n R.map (({counter}) =\u003E counter),\r\n R.filter(isOdd),\r\n R.map(square),\r\n R.filter(lessThanThreeDigits)\r\n)(data);","IsDeferred":false},{"Name":"Lodash","Code":"var result = _.chain(data)\r\n .map(\u0027counter\u0027)\r\n .filter(isOdd)\r\n .map(square)\r\n .filter(lessThanThreeDigits)\r\n .value();","IsDeferred":false},{"Name":"js native loops","Code":"let result = [];\r\nfor (let i=0; i\u003Cdata.length; i\u002B\u002B) {\r\n const { counter } = data[i];\r\n if (isOdd (counter)) {\r\n console.log (\u0027t\u0027, counter);\r\n let squared = square (counter);\r\n if (lessThanThreeDigits (squared)) {\r\n result.push (squared);\r\n }\r\n }\r\n}","IsDeferred":false}]}