DEV Community

Discussion on: A simple explanation of functional pipe in JavaScript

Collapse
 
tobbe profile image
Tobbe Lundberg

If all you need/want is the pipeWith function, it can be written like this (I prefer to call it just pipe):

const pipe = (arg, ...fns) => fns.reduce((v, f) => f(v), arg);