Skip to content

Latest commit

 

History

History
20 lines (14 loc) · 1.33 KB

using-this-correctly.md

File metadata and controls

20 lines (14 loc) · 1.33 KB

using-this-correctly

Date: 2016-01-10
Last Update: 2016-04-01

Using this correctly, requires knowing the context.

Often people use the this incorrectly. This is a common mistake. The Javascript this does NOT work like the Java this, nor like most computer languages.

The reason it does not work is because the this gets resolved at run-time, not assemble-time (or compile-time). When an event fires, this resolves to the global this because the function is now out of scope.

These videos should help.

Videos by Adam Breindel