Possible Duplicate:
JS: var self = this?
When looking at arbitrary code written in JavaScript (e.g. on GitHub), many developers use var self = this and then use self instead of this to reference the current object.
What is the rationale behind this approach?