News for hackers. Stuff that matters.
Re:Pipe Operator (|>) For JavaScript by wruza on Friday January 20, 2023 @06:22PM (#34461579)
it's still easy to read

That’s highly subjective I’m afraid.

“Take entries of envvars, turn that into k=v, join that by a space, make dim $, previous that, and args, log that”.

Personally I have no clue what’s going on at first glance with all these %%% “thats”. It’s meant to be declarative, but reads imperatively instead.

  console.log(chalk.dim(
    '$',
    ...Object.keys(envars)
      .map(k => `${k}=${envars[k]}`),
    'node',
    ...args,
  ))
“Log dimmed $, k=v pairs of envvars, node, then args”.
Re:Pipe Operator (|>) For JavaScript by hajile on Friday January 20, 2023 @08:33PM (#34462823)
That's why I prefer the F# version where it's just the names of functions or anonymous arrow functions. Nothing magical about them. It just calls the functions in order from top to bottom.