{"ScriptPreparationCode":" var data = _.range(10000).map(function(i) {\r\n return {\r\n counter: i\r\n }\r\n });\r\n \r\n function isOdd(num) {\r\n return num % 2 === 1;\r\n }\r\n \r\n function square(num) {\r\n return num * num;\r\n }\r\n \r\n function lessThanThreeDigits(num) {\r\n return num.toString().length \u003C 3;\r\n }","TestCases":[{"Name":"Lodash","Code":"var result = lodash.chain(data)\r\n .map(function(m) {return m.counter;})\r\n .filter(isOdd)\r\n .map(square)\r\n .filter(lessThanThreeDigits)\r\n .value();","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","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":"Underscore","Code":"var result = _.chain(data)\r\n .map(function(item) {return item.counter;})\r\n .filter(isOdd)\r\n .map(square)\r\n .filter(lessThanThreeDigits)\r\n .value();","IsDeferred":false},{"Name":"Vanilla v1","Code":"var result = data.map(function(x) {return x.counter})\r\n\t.filter(isOdd)\r\n\t.map(square)\r\n\t.filter(lessThanThreeDigits)","IsDeferred":false},{"Name":"vanilla v2","Code":"var result = [];\r\n\r\nfor (var i = 0, len = data.length; i \u003C len; i\u002B\u002B) {\r\n \tif (isOdd(data[i].counter)){\r\n var r = square(data[i].counter);\r\n if (lessThanThreeDigits(r)) {\r\n result.push(r);\r\n }\r\n }\r\n}","IsDeferred":false}]}