Skip to content

Instantly share code, notes, and snippets.

@BenBrostoff
Created June 27, 2018 15:56
Show Gist options
  • Save BenBrostoff/00fea17e4282203a82467bd0479d1615 to your computer and use it in GitHub Desktop.
Save BenBrostoff/00fea17e4282203a82467bd0479d1615 to your computer and use it in GitHub Desktop.
Log without removing immediate return
// thanks to @jnelson for showing me this technique
const original = () => process.env.someThing;
// you might be tempted to do this
const original2 = () => {
console.log(process.env.someThing);
return process.env.someThing;
};
// ...but not nearly as quick as
const original3 = () => console.log(process.env.someThing) || process.env.someThing;
// Obviously using a debugger is preferable to this, but oh well.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment