Skip to content

Instantly share code, notes, and snippets.

@hisasann
Created July 4, 2014 04:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hisasann/9438007d88f99ef5a2e7 to your computer and use it in GitHub Desktop.
Save hisasann/9438007d88f99ef5a2e7 to your computer and use it in GitHub Desktop.
呼び出し元の引数を破壊する
function func1(b) {
func2();
console.log(b); // IEではfalse
}
function func2(fn) {
arguments.callee.caller.arguments[0] = false; // 破壊した!
}
func1(true);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment