I mentioned two benefits I can see to Array.of over []-literals here:
https://twitter.com/#!/littlecalculist/status/89854372405723136
1) With Array.of you know you aren't going to accidentally create holes, and
2) if you're passing it to a higher-order function you know you aren't going to
trip over the single-uint32-arg special case.
That said, the "readability" story you and I tweeted about is not so compelling
given that, in the first-order usage pattern an array-literal is strictly more
readable. So a longer name like Array.fromElements or something might be okay.
Dave
On Jul 10, 2011, at 10:33 AM, Rick Waldron wrote:
> _that_ is the compelling use-case I was looking for.
>
> Rick
>
>
>
> -- Sent from my Palm Pre
>
> On Jul 10, 2011 1:23 PM, Brendan Eich <[email protected]> wrote:
>
> On Jul 10, 2011, at 10:18 AM, Rick Waldron wrote:
>
>> The more I think about it, I still can't come up with any really exciting
>> use cases where Array.of would outshine anything that already exists. I say
>> strike it from the wishlist.
>
> Higher-order programming with Array as constructing-function bites back for
> the single-number-argument case. That's where Array.of helps.
>
> /be
>
> _______________________________________________
> es-discuss mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/es-discuss
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss