Skip to content

Instantly share code, notes, and snippets.

@jpitchardu
Created May 23, 2018 16:31
Show Gist options
  • Save jpitchardu/a4555e26d384b86c190a809991f1f2c8 to your computer and use it in GitHub Desktop.
Save jpitchardu/a4555e26d384b86c190a809991f1f2c8 to your computer and use it in GitHub Desktop.
Null-Conditional in JS
let obj;
console.log(obj && obj.someProp); // Prints undefined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment