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

OP was talking about trading [] for {}. You can't splice on {}.


well, objects are not iterables... ??? unless you decide you want them to be, in which case you can make them such and design them in a way that they work as such?

The least elegant way is Object.keys().map(key => etc) which is really not that hard to work with

edit: it's a phony premise to begin with actually. Iterables have order, objects have mapping. I am less experienced with other languages so I probably don't understand OP's statement clearly. I just think OP's context is lazy thought rot about what's becoming a fairly elegant language. BUT I'm a noob.




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

Search: