Video – Master JavaScript ‘this’ in 30 Mins

Do you know, there are four ways to calculate the value of ‘this’ inside a JavaScript function? 

Some pointers about ‘this’ 

  • Every function has it’s own ‘this’ 
  • An arrow function does not have it’s own ‘this’
  • The value of ‘this’ depends on, how that function is called
  • The value of ‘this does not depend on how the function is created.

There are four ways a function can be called which are also known as Invocation Patterns. 

  1. Function Invocation Pattern – global object 
  2. Constructor Invocation Pattern – newly created object 
  3. Method Invocation Pattern – object before dot 
  4. Indirect Invocation Pattern- manually passed as the first parameter 

So there are four possible values of ‘this’ inside a function, that depend on the way the function is called. Keep in mind that, an arrow function takes ‘this’ from the execution context and it does not have its own ‘this’ object. 

Watch 30 mins long video to master ‘this’ here: 


Discover more from Dhananjay Kumar

Subscribe to get the latest posts sent to your email.

Published by Dhananjay Kumar

Dhananjay Kumar is founder of NomadCoder and ng-India

2 thoughts on “Video – Master JavaScript ‘this’ in 30 Mins

  1. Great breakdown of the different ways to calculate ‘this’ in JavaScript! Understanding the Invocation Patterns and how ‘this’ behaves in various contexts is crucial for mastering JavaScript.

    The distinction between regular functions and arrow functions is especially helpful. I’ll definitely check out the video to dive deeper into the topic. Thanks for sharing such a concise explanation!

Leave a comment

Discover more from Dhananjay Kumar

Subscribe now to keep reading and get access to the full archive.

Continue reading