5 ms·
If the pipeline operator gets accepted into JS[0], I think we should go in the direction of copying those as static methods. An example would look like: [1
by pg_bot 8y ago
If the pipeline operator gets accepted into JS[0], I think we should go in the direction of copying those as static methods. An example would look like:
[1,2,[3,4,5]]
|> Array.flatten()
|> Array.filter((x) => x % 2 === 0)
|> Array.map((x) => x * 2)
|> Array.reduce((acc, x) => acc + x)
[0]: https://github.com/tc39/proposal-pipeline-operator https://github.com/tc39/proposal-pipeline-operator