Pipe Operator (|>) For JavaScript
Is this:<p><pre><code>   Object.keys(envars)
     .map(envar =&gt; `${envar}=${envars[envar]}`)
     .join(&#x27; &#x27;)
     |&gt; `$ ${%}`
     |&gt; chalk.dim(%, &#x27;node&#x27;, args.join(&#x27; &#x27;))
     |&gt; console.log(%);
</code></pre>
Really better than:<p><pre><code>  console.log(chalk.dim(
      `$ ${Object.keys(envars)
        .map(envar =&gt; `${envar}=${envars[envar]}`)
        .join(&#x27; &#x27;)
      }`,
      &#x27;node&#x27;,
      args.join(&#x27; &#x27;)
  ));
</code></pre>
That&#x27;s the real-world example they have (I reformatted the second one slightly, because it looks better to me). Neither seems very good to me, and the |&gt; version doesn&#x27;t really seem &quot;less bad&quot;.<p>Can also write it as:<p><pre><code>   process.stdout.write(chalk.dim(
     `$ ${Object.keys(envars)
       .map(e =&gt; `${envar}=${e[envar]}`)
       .join(&#x27; &#x27;)
     }`,
   ))
   console.log(chalk.dim(&#x27;node&#x27;, args.join(&#x27; &#x27;)))
</code></pre>
Which seems clearer than either because it splits out &quot;print env variables&quot; and &quot;print out node args&quot;. And it would be even better with some sort of helper to convert an object to k=v string:<p><pre><code>   console.log(chalk.dim(`$ ${dumpObj(envars)}`, &#x27;node&#x27;, args.join(&#x27; &#x27;)))
</code></pre>
---<p>I also feel this:<p>&gt; In the State of JS 2020 survey, the fourth top answer to “What do you feel is currently missing from JavaScript?” was a pipe operator.<p>Is the wrong way to go about language design. Everyone wants something different, and if you just implement the &quot;top 5 most requested features&quot; you&#x27;re going to end up with some frankenbeast of a language.