Skip to content

Instantly share code, notes, and snippets.

@nythrox
Last active July 29, 2022 14:08
Show Gist options
  • Save nythrox/d96e838dcee8c61e2df104ec46fd5b47 to your computer and use it in GitHub Desktop.
Save nythrox/d96e838dcee8c61e2df104ec46fd5b47 to your computer and use it in GitHub Desktop.
Javascript pipeline operator using global mutable underline (_) variable
const envars = { secret: "hello world" }
const stringifyEnv = (env) => {
_= env
_= Object.keys(_)
_= _.map(envar => `${envar}=${envars[envar]}`)
_= _.join('&')
return _
}
console.log(stringifyEnv(envars))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment