Created
December 22, 2014 14:00
-
-
Save butchi/7529bf06c55113b08260 to your computer and use it in GitHub Desktop.
window.Objectのfalseのようなtrueの話 ref: http://qiita.com/butchi_y/items/0167ff91124c2f9bea2d
This file contains hidden or 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
({}) !== ({}); // == ? |
This file contains hidden or 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 a = {}; | |
var b = {}; | |
a[window] = 5; | |
b[window] = 5; | |
a[window] === b[window]; // == ? |
This file contains hidden or 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 obj = {}; | |
var obj = {}; | |
obj[window] = 5; | |
obj.window = 3; | |
obj[window] !== obj.window; // == ? |
This file contains hidden or 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 a = {}; | |
var b = {}; | |
a[{}] = 5; | |
b[{}] = 5; | |
a[{}] === b[{}] // == ? |
This file contains hidden or 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
!!(new Boolean(0)) // == ? |
This file contains hidden or 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 obj1 = {a:5,b:3,c:8}; | |
var obj2 = {b:3,a:5,c:8}; | |
var keys1 = ''; | |
var keys2 = ''; | |
var i; | |
for(i in obj1) { | |
keys1 += i; | |
} | |
for(i in obj2) { | |
keys2 += i; | |
} | |
keys1 !== keys2 // == ? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment