20. pipeline-operator

  1. const double = (n) => n * 2;
  2. const increment = (n) => n + 1;
  3.  
  4. // 没有用管道操作符
  5. double(increment(double(5))); // 22
  6.  
  7. // 用上管道操作符之后
  8. 5 |> double |> increment |> double; // 22