denysdovhan / wtfjs

🤪 A list of funny and tricky JavaScript examples
http://bit.ly/wtfjavascript
Do What The F*ck You Want To Public License
35.2k stars 2.55k forks source link

About the "arguments" #35

Closed zswang closed 3 years ago

zswang commented 7 years ago
function a(x) {
  arguments[0] = 'hello';
  console.log(x);
}

a(); // -> undefined
a(1); // -> "hello"
futurist commented 7 years ago

arguments and x is 2-way binding, If no x, then no 2-way binding, so a() is undefined.

denysdovhan commented 7 years ago

@zswang would you like to send a PR?

denysdovhan commented 3 years ago

Added. Will be published soon.

github-actions[bot] commented 3 years ago

:tada: This issue has been resolved in version 1.17.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: