Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
thisがarguments.calleの作用で変化してしまう
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