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

About the question about "this" in JavaScript. And how to "get rid of it". I always give it another name! Like car = this. Then I'll write car.engine instead of this.engine. It makes life much easier as I do not have to worry about "car" changing in sub-functions. And it's much easier to search and replace if I want to change the variable name.


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

Search: