2 comments

[ 3.0 ms ] story [ 16.4 ms ] thread
I wrote this short article about "this" in the hope to make code more readable and save you from debugging time.

Feel free to comment on it here or call BS. I'm here to learn. :)

Depends on your team's conventions. I started doing this on a team where "var self = this" was the convention (lots of Backbone code), so to the rest of my team, "var view = this;" et. al were actually less readable (because they broke the reader's expectations).