Created
June 27, 2018 15:56
-
-
Save BenBrostoff/00fea17e4282203a82467bd0479d1615 to your computer and use it in GitHub Desktop.
Log without removing immediate return
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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