call, apply and bind methods| Method Borrowing | Modern Javascript 2021

Published: 27 August 2021
on channel: Nisha Singla
12,000
425

call, apply and bind are predefined methods in javascript and its very using to handle this keyword .
this keyword work quiet differently in javascript as compared to other object oriented language and that creates confusion for the programmers.

Function borrowing allows us to use the methods of one object on a different object without having to make a copy of that method and maintain it in two separate places. It is accomplished through the use of .call(), .apply(), or .bind(), all of which exist to explicitly set this on the method we are borrowing.
There are many benefits to method borrowing:
It prevents the unnecessary duplication of code.

It allows the user to use methods of different objects without inheriting.

Using method borrowing prevents the replication of methods in multiple object blocks and saves time.

call, apply and bind method is just to implement method borrowing, where we can use explicitly specify what this should reference within the calling function.

In this video, I have explained how you should write your functions so that you can optimised your code and can clear the coding round during your interview.

Support my channel so that I can reach to wider audience. Please share it in your network 🙏

Connect with me on social platform:
Facebook:   / angularjs4beginners  
LinkedIn:   / nisha-singla-82407aa0  
Instagram :   / passion4code  

For more such interesting videos, please subscribe to my channel and stay connected.

#javascript #NishaSingla #callapplybind


On this page of the site you can watch the video online call, apply and bind methods| Method Borrowing | Modern Javascript 2021 with a duration of hours minute second in good quality, which was uploaded by the user Nisha Singla 27 August 2021, share the link with friends and acquaintances, this video has already been watched 12,000 times on youtube and it was liked by 425 viewers. Enjoy your viewing!