The value of this in JavaScript can be tricky to some of us and the reason why adding a .bind(this) solves a particular problem is sometimes a mystery. While you are happy you found the fix, you don’t always have time to look deeper to understand why this works. But not understanding why it works usually means that you won’t understand why when it doesn’t work.

call, bind and apply are not to be found in every second line of code, but if you ever used React you probably came across the following use of bind:

#coding #programming #javascript #react #web-development

Understand call, bind and apply in JavaScript
1.75 GEEK