Hacker News new | past | comments | ask | show | jobs | submit login

That works, too!

The reason I like using _obj is because "this" is notoriously hard to work with in JS. If, inside foo(), you have an iterator that you pass a function to, "this" takes on a different meaning inside that function.

Some people are really good at working out what "this" refers to, but I'm not. So I assign the main object to _obj just to be safe.




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

Search: