quick clarification: the length only represents the number of normal named identifier params, from left to right -- count stops once it encounters a default param, a destructuring param, or a rest param. function foo(a, b, c = 3, ...d) {} foo.length; // 2
That explanation breaks down in the face of the shadowing behavior. function foo(a, b) { a = 9; b = 8; console.log(arguments); } foo(1, 2);
-
-
I know about the shadowing and I mentioned it in my earlier tweet ("...deep reference..."). but i think my assertion stands, given that nobody in their right mind uses that intentionally, and strict mode eliminated it. I'd wager > 99% have never even heard of or considered it.
-
And now you have to explain what “deep reference” means. It’s not accurate; it’s not a reference to the original values that were passed, nor to their bindings, as the example shows. Just seems easier to use the terminology that’s in the language instead of mixing things up.
- 5 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
JavaScript, HTML, CSS, HTTP, performance, security, Bash, Unicode, i18n, macOS.