WatchMeCode

screencasts by derick bailey

be the first to know about new episodes

Episode 4: Context In JavaScript

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.

Watch The Preview For "Context In JavaScript."

What you'll learn:

  • 5 Function Invocations
  • Standard Function Context
  • Object Method Context
  • `.call` Context
  • `.apply` Context
  • Constructor Function Context
  • Callback Function Context
  • Bound Function Context
  • JavaScript Mixins
  • ... and more!

What you'll get:

  • 30 minutes of video
  • Complete transcript
  • Named chapters
  • Download, to take it with you
  • 720p HD video
  • Chapter markers (.mov only)
  • Multiple formats (.mov, .mp4)

Quotes and reactions from viewers

"Your teaching style is very good. Everything is nicely displayed and you speak very clearly. I learned alot about the intricacies of JavaScript. My journey continues!" - Kirk
"Since watching your videos I've really changed the way I write JS, for the better! Just want to say thanks!" - Phillip
"[This] is great. I had no idea that JavaScript is such a #WTF language (the opposite of Ruby's "least surprise")" - @Sleeptillseven

blog comments powered by Disqus
Published: 2012-01-17. Running Time: 30+ minutes.