Last active
January 4, 2021 21:32
-
-
Save codingedgar/d44152224b7b410a84117dfff3b03a0f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
console.group('Eager Setter with Nullish Coalescing Operator'); | |
const anotherRandomCat = new Cat('Pepo'); | |
anotherRandomCat.name = anotherRandomCat.name ?? 'Luna' | |
console.assert(anotherRandomCat.name === 'Pepo'); | |
console.groupEnd(); | |
/* | |
Console: | |
Eager Setter with Nullish Coalescing Operator | |
get called Pepo | |
set called Pepo | |
get called Pepo | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment