You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I also consider function.arguments to be equivalent to capturing all arguments using the ... rest operator, eg.:
constfoo=(bar,baz=123)=>{return{
bar,
baz,arguments: function.arguments,};};
Is equivalent to the following ES2015 transpiled code:
constfoo=(..._functionArguments)=>{var{0: bar,1: baz=123}=_functionArguments;return{
bar,
baz,arguments: _functionArguments;};};Object.defineProperty(foo,"length",{value: 1,configurable: true});
Or transpiled to ES5:
varfoo=function(bar){var_functionArguments=[];for(vari=0,length=arguments.length;i<length;i++){_functionArguments[i]=arguments[i];}varbaz=_functionArguments[1];if(baz===undefined){baz=123;}return{
bar,
baz,arguments: _functionArguments;};}
Should it return a frozen array every time it's evaluated? Is there any use case for which mutability of this array would be desired?
The text was updated successfully, but these errors were encountered: