JavaScript 'this' keyword tutorial in Bangla - .call(), .apply() and .bind()

Learn with Sumit - LWS - Bangladesh
Learn with Sumit - LWS - Bangladesh
28.7 هزار بار بازدید - 4 سال پیش - If we want to define
If we want to define the "this" keyword, we can say that it allows you to reuse functions with different contexts. "this" keyword is one of the weirdest parts of JavaScript. Often in larger applications, programmers find it difficult to figure out what "this" refers to. In this video, I have tried to explain 4 rules that would help you solve the problem. While explaining "this" keyword, I have also introduced "call()", "apply()" and "bind()" rather than creating separate tutorials for them. I hope you will find this video useful.

▬ Contents of this video  ▬▬▬▬▬▬▬▬▬▬

0:00 - Intro
0:45 - Practical Example
2:24 - Listing rules
4:45 - Implicit Binding
16:10 - Explicit Binding (call)
20:44 - Explicit Binding (apply)
21:31 - Explicit Binding (bind)
23:30 - new Binding
27:10 - window Binding

N.B: Please note that, one thing I missed to point out in the video that - in case of arrow function, the "this" keyword behaves differently. Arrow functions don't redefine "this" as their semantics are different. Hope that clears any confusion.
4 سال پیش در تاریخ 1399/06/18 منتشر شده است.
28,747 بـار بازدید شده
... بیشتر