Solving problems with Execution Context, this, and Timers

preview_player
Показать описание
This video explains how the value of `this` will change when you are using timers with setTimeout and setInterval due to the switch in execution context.
Two approaches to avoiding / solving this problem are explained in detail

Рекомендации по теме
Комментарии
Автор

Jesus! Finally I got it why do we lose the execution context and This = window when we write ( obj.method, 1000 ) inside a timer. Thank you very much!

RemzM
Автор

Very good explanation with easy to understand examples. It's always funny to wrap my head around execution context, this and when I need to use the .bind() method.

Kay_Drechsler
Автор

Thank you! Very very clear explanation. I finally start to understand concept of execution context and how to configure it in different cases.

jimshtepa
Автор

out of curiousity, what drives you to invest resources (time, human effort etc) to create these materials and publish them? The quality of the content is so good even compared to paid ones

jimshtepa
Автор

5:34 what is the reason to add the method instead of putting the in the body of the function? Does running an empty function with the 'new' word in front of it create an object literal?

jimshtepa
Автор

hi, I have seen .bind(this), what is the point of doing this? it was like foreach(function(){ //some code }.bind(this)); can you please help me

ameenbari
Автор

How to remove black space from video html css javascript

viral_agent