Last active
January 4, 2021 21:32
-
-
Save codingedgar/eac8e5a3ea6784d9c7e77364e136a7c0 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
const aNewCat = new Cat(); | |
aNewCat.name ??= 'Artemis'; | |
console.assert(aNewCat.name === 'Artemis'); | |
aNewCat.name ??= 'Nirvana'; | |
console.assert(aNewCat.name === 'Artemis'); | |
console.groupEnd(); | |
/* | |
Console: | |
Logical Nullish Assignment | |
get called undefined | |
set called Artemis | |
get called Artemis | |
get called Artemis | |
get called Artemis | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment