undefined in JavaScript
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
var emp = { | |
name: 'John Snow', | |
email: 'john.snow@abc.com' | |
} | |
console.log(emp.name); | |
//John Snow | |
console.log(emp.address); | |
// undefined (here we are trying to extract a member which object doesn't have) | |
var test; | |
console.log(test); | |
//undefined (a variable defined but not initialized) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment