Array.create and Function.create

Jordan Harband ljharb at gmail.com
Thu Jan 10 21:19:28 UTC 2019


Sorry if I was unclear; it's *impossible* to have an array without a
`.length` own property, and there'd be no way to get the length or iterate
over it if you did. I'm also not clear on why you'd want to store named
properties on an array, especially if you can't iterate it because it
doesn't have a length?

On Thu, Jan 10, 2019 at 11:04 AM T.J. Crowder <
tj.crowder at farsightsoftware.com> wrote:

> On Thu, Jan 10, 2019 at 1:54 PM Augusto Moura
> <augusto.borgesm at gmail.com> wrote:
> >
> > If you don't want the iterable features neither the own properties,
> > what're the benefits over a object indexed by numbers `const o =
> > Object.create(null); o[0] = 12; ...`?
>
> Exactly.
>
> And re functions, using them as state containers without their usual
> features seems like a bad idea^H^H^H^H^H^H^H^H edge case best handled
> by `setPrototypeOf` and `delete`. :-)
>
> -- T.J. Crowder
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20190110/77993891/attachment-0001.html>


More information about the es-discuss mailing list