When was the last time JavaScript's "this" worked the way you thought it did? You have an object with a function, and you call "this" to get some data from the it only to find that the data isn't there because "this" isn't the object you thought it was! In this episode, we'll look at all function invocations and how they manipulate "this". We'll also see some common scenarios that trip people up, like passing an object's method as a callback.
Join me as I explore and explain context in JavaScript's functions, and show you how to bend it to your will. We'll see how we can manipulate a function's context directly and we'll look at some great ways to work around the strangeness bit, including ignoring context entirely by using storing it for later, and permanently binding a function's context to whatever we want.