I think that we can't add a new parameter on `Object.keys`, because it
could be a break change (and it will be a little bad to read).
We could add a new method on `Object`, like `Object.keysSet`, but I don't
know how important it is.

On Sun, 18 Oct 2020 at 04:26, #!/JoePea <[email protected]> wrote:

> Well that makes sense! Would it be worth adding an option like
> `Object.keys(obj, true)` to return a set? Or perhaps
> `Object.keySet(obj)`?
> #!/JoePea
>
> On Fri, Oct 16, 2020 at 11:54 PM Jordan Harband <[email protected]> wrote:
> >
> > Because Object.keys was standardized in 2009, 6 years before Set existed.
> >
> > On Fri, Oct 16, 2020 at 6:51 PM #!/JoePea <[email protected]> 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
> >> [email protected]
> >> https://mail.mozilla.org/listinfo/es-discuss
> _______________________________________________
> 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

Reply via email to