{"ScriptPreparationCode":"var data = [];\r\nfor (var i = 0; i \u003C 10000; i\u002B\u002B) {\r\n data.push({ counter: i });\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}\r\n\r\nvar expected = data.map(o =\u003E o.counter).filter(isOdd).map(square).filter(lessThanThreeDigits);","TestCases":[{"Name":"Lodash","Code":"var result = _.chain(data)\r\n .map(d =\u003E _.get(d, \u0027counter\u0027))\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":"VanillaJS functional style","Code":"var result = data.map(o =\u003E o.counter).filter(isOdd).map(square).filter(lessThanThreeDigits);","IsDeferred":false},{"Name":"VanillaJS procedural","Code":"var result = new Array();\r\nfor (var i = 0; i \u003C data.length; i\u002B\u002B) {\r\n var c = data[i].counter;\r\n if (isOdd(c)) {\r\n var r = square(c);\r\n if (lessThanThreeDigits(r)) {\r\n result.push(r);\r\n }\r\n }\r\n}","IsDeferred":false}]}