What underlies this JavaScript idiom: var self = this?
See this article on alistapart.com. (Ed: The article has been updated since originally linked) self is being used to maintain a reference to the original this even as the context is changing. It’s a technique often used in event handlers (especially in closures). Edit: Note that using self is now discouraged as window.self exists and … Read more