JavaScript: this is it by Delicious Insights

JavaScript: this is it

You’ll finally understand how this works in JavaScript… And you can bet it’s worth it!

Finally grok’ing this!

If a topic’s been, by itself and forever, the source of easily half the questions you see online about JavaScript, that topic has to be how this works. “Hey?! I just lost my this!“ or “what the—why is this like that now?!” are a dime a dozen. We come from other languages and cargo-cult our assumptions along.

Frankly, this is all because developers would rather die than read the docs. The behavior of this is clearly described… but not as crystal-clear as this course. 😉 At the language level, a single, simple rule governs the behavior of this. That’s it. Beyond that, APIs we use can alter that behavior to better suit their needs, as in the DOM or Node streams.

When you’re done with this course, you’ll be a certified Master Of This™, and won't ever get caught off-guard by how it behaves. Freedom!

Slides and code

We know that getting a solid grasp on underlying concepts and theory is just as important as knowing how to implement them, so the course goes back-and-forth between elements of lecture (a la Powerpoint) and concrete code examples that can run in either Node or browsers.

Not only that, but the contents of these slides strives to remain concise and offer a welcome complement to the more detailed explanations in the audio track, whilst allowing you to “follow” the course even if you’re watching it in a noisy environment.

All code samples are provided in addition to the videos. And you retain a free lifetime access to updates and upgrades we might put in later!
Video Icon 21 videos File Icon 2 files Text Icon 1 text file

So what’s in this course?

Before we start…
All videos in one download
644 MB
All code examples in one download
21.3 KB
The Great Misunderstanding
Intro
2 mins
Methods or functions? References and first-class functions
4 mins
How do I know what this is?
The golden rule
5 mins
this is defined at call-time
4 mins
What about outside the golden rule?
4 mins
Common API behaviors
4 mins
What about arrow functions?
Reminders on arrow functions
3 mins
Execution context
6 mins
Lexical resolution
9 mins
Arrow functions are not a silver bullet!
3 mins
Explicitly specifying this
Functions are objects
3 mins
call()
4 mins
apply()
3 mins
Ensuring a given this
bind()
5 mins
Re-implementing bind()
7 mins
Re-implementing bind(): visual run-through
4 mins
The binding operator
3 mins
Explicit guarantee in the constructor
5 mins
Implicit guarantee by field initializer + arrow function
3 mins
Explicit guarantee by decorator
3 mins
Want more video courses?
3 mins
Further reading…

FAQs

😎 Do I need prior JS experience?

If you never wrote JS or never had to wrestle with this, you likely won’t get all the juice out of this course. But if you ever stumbled on a this-related issue, or just wondered where its values came from, this course will help!

🦕 Is this course compatible with IE?

The world is not compatible with IE. 😜

In all seriousness though, 100% of this course is valid on IE. We’re talking about JS fundamentals here that have been true since the language first came to light.

However, post-2009 syntax (arrow functions, field initializers and decorators, specifically) won't work natively on IE: you'll need to transpile them with Babel, for instance.

🎁 Do you provide the code samples too?

Of course we do! Every section opening has a link to a Zip file with all the code samples for that section.

Some rare examples might not be runnable as-is (e.g. those assuming a database or something), but the vast majority can be run as-is in Node and/or a modern browser.

📥 Can I download the videos for offline viewing?

Yes! Every section opening contains a link to a Zip file with all the MP4 video files for that section, that you can download to view or review when you’re offline. Note that a low bandwidth is enough to watch them online, though, and that gets you extras like transcripts and related contents.

🆓 Do you offer free JS-related content?

Do we ever! Our tech articles on JavaScript are many and in-depth; you'll also find a number of videos from our conference talks or meetups about JavaScript, Node.js and the whole ecosystem. Some examples:

🎓 Do you do in-room trainings?

We sure do! We probably have the world’s most comprehensive JS training: 360° ES. 3 days to cover 100% of the language, including all the latest bells and whistles and all the nitty-gritty, for people who already use JS daily.

We also have Modern Web Apps about client-side rich web apps and PWAs, Node.js for the back-end API part (REST and GraphQL both) and Webpack for bundling, all of which are acclaimed by our trainees!

A course by Christophe

Christophe Porteneuve has been doing JavaScript since… JavaScript. And professionally since 1996. A former core team member on Prototype.js, co-author of a TC39 spec and world-renowned JS expert, he's got 15,000+ hours as a trainer and dozens of conference talks behind him. In this course, he makes sure to share his technical expertise with humor and clarity.