About Array.of()

Rick Waldron waldron.rick at gmail.com
Mon Aug 27 19:09:14 PDT 2012

On Mon, Aug 27, 2012 at 9:41 PM, Brendan Eich <brendan at mozilla.org> wrote:

> Shijun He wrote:
>> On Tue, Aug 28, 2012 at 4:38 AM, Rick Waldron<waldron.rick at gmail.com**>
>>  wrote:
>>> Regardless of its repositioning on the right as a property, I would
>>> intuitively expect "new" to behave the same way it would as its operator
>>> equivalent (for all constructors, not just Array). By no means do I wish
>>> to
>> I agree you 'new' should match constructor, except Array. Array
>> constructor is broken (that's why we need Array.of/new/create
>> whatever) and NO ONE really use Array constructor at all (programmers
>> are educated to use literal initializer instead).
> Too true.
> Rick, it's important not to make a false idol out of precedent.

You're absolutely right, sometimes my intentions to speak for the wider
population act as blinders.

> When people want an Array constructor, they don't think "especially one
> that treats the case where it is called with a single argument of number
> type as a request to make an array with that many holes"!

You got me there :P


> /be
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120827/e71a84d5/attachment.html>

More information about the es-discuss mailing list