return when desugaring to closures

Peter Michaux petermichaux at gmail.com
Thu Aug 21 19:04:03 PDT 2008


On Thu, Aug 21, 2008 at 6:34 PM, Brendan Eich <brendan at mozilla.org> wrote:

[snip]

> The destructuring pattern here is an array, but objects work too:
>
> js> let {length: len} = foo()

The above has always instinctively looked to me like the variable
"length" is being assigned the value of the "len" property of the
object returned by foo. That is the way an object literal works: the
right value is assigned to the left property.

[snip]

Peter


More information about the Es-discuss mailing list