Last active
November 8, 2019 18:38
-
-
Save IntegerMan/98342e5279ba1c872a24213a0a41329d to your computer and use it in GitHub Desktop.
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
// 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