3 ms·
I take you are no big fan of Lisp? /s Well, actually I agree with you - sometimes. I have actually written helper functions to get similar pipeline processing
by pintxo 5y ago
I take you are no big fan of Lisp? /s
Well, actually I agree with you - sometimes. I have actually written helper functions to get similar pipeline processing capabilities in js.
function pipe(...args) {
return args.reduce((x, fn) => fn(x), null);
}
pipe(
() => 2,
(x) => 7*x,
console.log
)