Is this correct?
const pipeOnce = (fn1, fn2) => (args) => (fn2(fn1(args))); const pipe = (...ops) => ops.reduce(pipeOnce);
It seems for me pipeOnce should be
(acc, fn) => fn(acc)
Though it would not be 'pipeOnce' by semantic anymore:)
Heh, well this shows that thinking about it is more complicated than the for..of loops.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Is this correct?
It seems for me pipeOnce should be
Though it would not be 'pipeOnce' by semantic anymore:)
Heh, well this shows that thinking about it is more complicated than the for..of loops.