@Eli you are correct, my mistake. I have not heard of the pipeline operator
proposal before, I use a similar syntax in Elixir and enjoy it thoroughly.

On Jul 16, 2017 7:14 PM, "Oriol _" <[email protected]> wrote:

> I don't see the point in this `tap`. The `myReverse` example can be
> written as
>
> ```js
> const value = myReverse([1, 2, 3].map(String)).map(num => num * 2);
> ```
>
> If you don't want to write `myReverse` at the beginning, you might like
> the pipeline proposal: https://github.com/gilbert/es-pipeline-operator
> I think it would be something like
>
> ```js
> const value = [1, 2, 3]
>   .map(String)
>   |> myReverse
>   |> arr => arr.map(num => num * 2);
> ```
>
> And similarly for the `console.log` example:
>
> ```js
> [1, 2, 3]
>   .map(num => num * 2)
>   |> arr => { console.log(arr); return arr; }
>   |> arr => arr.reduce((a, b) => a + b);
> ```
>
> --Oriol
>
>
> _______________________________________________
> es-discuss mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/es-discuss
>
>
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to