Why does Object.keys return an Array instead of a Set?

Jordan Harband ljharb at gmail.com
Sat Oct 17 06:54:12 UTC 2020


Because Object.keys was standardized in 2009, 6 years before Set existed.

On Fri, Oct 16, 2020 at 6:51 PM #!/JoePea <joe at trusktr.io> wrote:

> Sets are faster, even for tiny lists of four items. See the perf tests
> (tested in Chrome):
>
> https://twitter.com/trusktr/status/1315848017535098880
>
> https://twitter.com/trusktr/status/1317281652540731392
>
> #!/JoePea
> _______________________________________________
> 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/20201016/ad4313d6/attachment.html>


More information about the es-discuss mailing list