Created
October 23, 2023 13:36
-
-
Save saeedvakili/4cbc7c951aa53f4468c419be2f2d19df 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 user = { age: null }; | |
// if (!user.age) user.age = "unknown"; | |
user.age ??= "unknown"; | |
console.log(JSON.stringify(user)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment