Skip to content
JS

Understand JavaScript's this Keyword in Depth

Course on egghead by Marius Schulz

View on egghead (opens in a new tab)
18 min
LengthVideo runtime
Subscription
Price modelegghead plan
8
Lessons
4.7
Rating out of 580 ratings on egghead
Dec 2017
Published5 Dec 2017

About this course

Description from egghead

JavaScript’s this keyword is a source of confusion for new and experienced developers alike. It can be frustrating if, for some reason, this doesn’t point to the context that was intended. This course will help you understand JavaScript’s this mechanism in-depth. Marius will take us through all of the ways this will change its values, from why many libraries use "use strict" to how arrow functions take its outer execution context’s this . Over 8 lessons, you’ll learn: - how JavaScript implicitly sets the this context, and how we can set it ourselves - that the call-site of a function determines the this value of that function invocation - how to call a function with a specific this value - how to create functions that always remain tied to a specific this context - how this is treated within arrow functions and classes Following the course, this will feel less frustrating, more...

What it covers

8 lessons
  1. 1this in the Global Context
  2. 2this in Function Calls
  3. 3this in Constructor Calls
  4. 4this in Method Calls
  5. 5Specify this using .call() or .apply()
  6. 6Hard-Bind a Function's this Value with the .bind() Method
  7. 7Capture this with an Arrow Function
  8. 8this in Class Bodies

Similar JavaScript courses

  1. Asynchronous JavaScript with async/await

    egghead · Marius Schulz · 8 lessons · 4.7 from 106 ratings · May 2017

    18 minSubscription
    egghead84.7 (106)May 2017
  2. Write simple asynchronous code with JavaScript generators

    egghead · Max Stoiber · 6 lessons · 4.6 from 79 ratings · Mar 2017

    16 minSubscription
    egghead64.6 (79)Mar 2017
  3. Advanced Logging with the JavaScript Console

    egghead · mykola bilokonsky · 7 lessons · 4.7 from 25 ratings · May 2016

    22 minSubscription
    egghead74.7 (25)May 2016
  4. Beginner40 minSubscription
    Educative10Nov 2024
  5. Beginner1 h
    CourseraOct 2020
  6. How to Deploy a Website

    Codecademy · 3 lessons · Apr 2018

    Beginner1 h
    Codecademy3Apr 2018
  7. Beginner1 h
    CourseraMay 2024
  8. Beginner1 h
    Codecademy2Nov 2018

A hyphen means the provider's catalogue does not state the value.

Same topic, nearest in length, up to three from any one provider.

Data read from the egghead catalogue on 28 Nov 2026. How the data is collected.

    Compare