Last active
December 11, 2015 22:09
-
-
Save yangsu/4667566 to your computer and use it in GitHub Desktop.
JavaScript Variables
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
dontDoThis = 'ever !!!'; | |
var a; | |
if (a === undefined){ | |
console.log('a is ' + a); // 'a is undefined' | |
} | |
if (b) {} // this will generate an error "ReferenceError: b is not defined" | |
var n = null; | |
console.log(n * 32); // 0. Note: implicit type conversion | |
var c = 1, d, e = {}; | |
console.log(c, d, e); // 1 undefined {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment