Created
September 3, 2011 12:50
-
-
Save ishiduca/1191144 to your computer and use it in GitHub Desktop.
=== と ==
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
function test (a) { | |
console.log(a === false); | |
} | |
function test_near (a) { | |
console.log(a == false); | |
} | |
var arry = [ false, true, null, undefined, '', 0, '0' ]; | |
arry.forEach(function (flg) { | |
test(flg); | |
}); | |
arry.forEach(function (flg) { | |
test_near(flg); | |
}); | |
// ('' == false) -> true; | |
// (0 == false) -> true; | |
// ('0' == false) -> true; | |
// ('' === false) -> false; | |
// (0 === false) -> false; | |
// ('0' === false) -> false; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment