Created
July 4, 2014 05:03
-
-
Save hisasann/facb425133b2db459865 to your computer and use it in GitHub Desktop.
thisがarguments.calleの作用で変化してしまう
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 global = this; | |
(function (b) { | |
if (b) { | |
console.log(global === this, '1'); // true | |
arguments.callee(); | |
return; | |
} | |
console.log(this[0]); // true | |
console.log(global === this, '2'); // thisが変化してfalse | |
})(true); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment