Plato on Github
Report Home
src/concise.js
Maintainability
83.22
Lines of code
25
Difficulty
13.22
Estimated Errors
0.20
Function weight
By Complexity
By SLOC
(function() { 'use strict'; const numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; const isGreatherThan = function(pivot) { return function(n) { return n > pivot; }; }; const isEven = function(n) { return n % 2 === 0; }; const sqrtLessThan = function(pivot) { return function(n) { return Math.sqrt(n) < pivot; }; }; const double = function(n) { return n * 2; }; const add = function(a, b) { return a + b; }; console.log( numbers.filter(isEven) .filter(isGreatherThan(3)) .filter(sqrtLessThan(3)) .map(double) .reduce(add) ); })();