Clarification on function default param values

Mark Miller erights at
Tue Oct 1 18:09:14 PDT 2013

On Tue, Oct 1, 2013 at 3:16 PM, Claus Reinke <claus.reinke at>wrote:

> Generally variables are brought into scope by an explicitly appearing
>> defining occurrence. Two exceptions are the "function" brings into scope
>> both "this" and "arguments". These remain in scope until shadowed by a
>> nested "function" or by an explicit definition. Note that "this" can never
>> be explicitly defined, and "arguments" can only be explicitly defined in
>> non-strict code.
>> As of ES6, a variety of other function-defining constructs, like
>> "function", implicitly bring into scope a new "this" and "argument".
>> Arrow-functions are not one of these. Within an arrow function, both
>> "this"
>> and "arguments" are lexically captured from the enclosing context.
> Also "super" (implicitly bound in "function", available lexically scoped
> in arrow function body).
> Still following the rule: arrow functions have no implicit bindings and do
> not interfere with lexical scope (other than adding explicit bindings for
> their parameters).

Excellent point!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list