Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Map and set are much nicer in ES6 as built in objects.


imo map and set useless. Real advantage of maps only that you can use any type of keys, but really why not convenrt them to string represntation and put to simple object? Map .has method uses === for object search. For set the same, just use object with keys and dummy values.


> but really why not convenrt them to string represntation and put to simple object?

Because as soon as you might have "toString" or "__proto__" as a key things go all haywire.


Why do all these strange workarounds?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: