Created
December 7, 2015 20:58
-
-
Save mackenco/bc9ef211c999567966a6 to your computer and use it in GitHub Desktop.
Some FUN equality tests
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 num1 = true; | |
if (num1) { | |
console.log("number 1"); | |
} | |
var num2 = false; | |
if (num2) { | |
console.log("number 2"); | |
} | |
var num3 = "true"; | |
if (num3) { | |
console.log("number 3"); | |
} | |
var num4 = "false"; | |
if (num4) { | |
console.log("number 4"); | |
} | |
var num5 = null; | |
if (num5) { | |
console.log("number 5"); | |
} | |
var num6 = undefined; | |
if (num6) { | |
console.log("number 6"); | |
} | |
var num7 = "Daniel Lin"; | |
if (num7) { | |
console.log("number 7"); | |
} | |
var num8 = 9000; | |
if (num8) { | |
console.log("number 8"); | |
} | |
var num9 = 1; | |
if (num9) { | |
console.log("number 9"); | |
} | |
var num10 = 0; | |
if (num10) { | |
console.log("number 10"); | |
} | |
var num11 = NaN; | |
if (num11) { | |
console.log("number 11"); | |
} | |
var num12 = "NaN"; | |
if (num12) { | |
console.log("number 12"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment