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

string.indexOf() is O(n), whereas the object-property-lookup is O(1). I guess indexOf is fast enough anyway given the size of the dictionary.


Is this a bug in HN? I guess this was meant to be posted to the dictionary/javascript topic?


More likely my mistake; yes it was intended for http://news.ycombinator.com/item?id=2329940 . Why are people upvoting my comment?!


Apparently discussing code on Hacker News is never off-topic ;)


I upvoted it because I was looking for the underlying meaning of an elegant comment. Surely it means something, I said...


It's nice to see some hard tech content every now and then, even if non-sequitir.




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

Search: