Created
March 2, 2020 22:18
-
-
Save akshayjai1/89fe354c11545d1a6cb6fd9369f6975e 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
let customer = { | |
name: "Carl", | |
details: { age: 82 }, | |
surname: "" | |
}; | |
console.log(customer?.city ?? "Unknown city";); // Unknown city | |
console.log(customer?.city ?? "Unknown city";); // Unknown city | |
console.log(customer?.surname ?? "Unknown city";); // '' | |
console.log(customer?.surname || "Unknown city";); // Unknown city |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment