Context in JavaScript: A Guide to this, bind, call and apply
The value of this depends on how a function is called, not where it is written. I go through each case, then show how bind, call and apply let you set the context yourself.
Read the full post on Medium.