Created
June 29, 2022 13:28
-
-
Save PaulRosset/fa879ac102aa259e2e545b8b9fe10ec4 to your computer and use it in GitHub Desktop.
Coalescing operator example
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
| const contactInfos = { address: "20B Rue Lafayette", addressNumber: 0 }; | |
| console.warn(contactInfos.addressNumber || undefined) // undefined | |
| console.warn(contactInfos.addressNumber ?? undefined) // 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment