Skip to content

Instantly share code, notes, and snippets.

@IntegerMan
Last active November 8, 2019 18:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IntegerMan/98342e5279ba1c872a24213a0a41329d to your computer and use it in GitHub Desktop.
Save IntegerMan/98342e5279ba1c872a24213a0a41329d to your computer and use it in GitHub Desktop.
// Old Way
var calculator = someCalculator;
if (calculator !== null && calculator !== undefined) {
calculator = new Calculator();
}
// New Way
var calculator = someCalculator ?? new Calculator();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment