Skip to content

Instantly share code, notes, and snippets.

@smpnjn
Last active December 5, 2020 12:14
Show Gist options
  • Save smpnjn/e915e44da0d5c3e7fbc37801aca1ee18 to your computer and use it in GitHub Desktop.
Save smpnjn/e915e44da0d5c3e7fbc37801aca1ee18 to your computer and use it in GitHub Desktop.
let defineUser = {
name: "Markus",
age: 29,
location: {
country: "USA"
}
}
if(typeof defineUser.location !== "undefined" && typeof defineUser.location.address !== "undefined") {
console.log(defineUser.location.address);
}
else {
console.log("No address is defined");
if(typeof generateAddress !== "undefined") {
generateAddress();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment