Don't use "self" as a Javascript variable

Posted . Visible to the public.

You might sometimes use self to capture the context of this before it is destroyed by some function.

Unfortunately self is also an alias for window Show archive.org snapshot , the global top-level object. Save your future self some headaches and use another name like me instead (Coffeescript chose to use _this Show archive.org snapshot ).

Henning Koch
Last edit
License
Source code in this card is licensed under the MIT License.
Posted by Henning Koch to makandra dev (2014-01-12 08:10)