o9s
is a microblog
home archives search feed blogroll


The Pipeline Operator

As of now it’s only supported in Firefox 58+ behind the compile flag –enable-pipeline-operator.

const increment = (n) => n + 1;
const double = (n) => n * 2;
const triple = (n) => n * 3;

1 |> increment |> double |> triple; // 12

It reminds me of pipes in bash.

ls | grep "\.txt$"

Github

Posted on 2018-01-11   #javascript     #bash  






← Next post    ·    Previous post →