DEV Community

Discussion on: Piping JavaScript

Collapse
 
codebryo profile image
Roman Kuba

As I didn't come around to try this yet, I have one question.
Does the pipe operator know where to put the output of the previous function as input on the next one?
I am asking because:

const add2Days = addDays(2);

Takes the value as the second param.

const customFormat = format("D MMMM YYYY");

though takes the value as the first param.

Overall I think it's awesome that this comes to JS.
And a thank you for the posts you are putting out. Always looking forward to them.

Collapse
 
kayis profile image
K • Edited

I think I wrote it wrong. It always uses the first argument. fixed it.