Call, Apply and Bind in Javascript
Call is a function that helps you change the context of the invoking function. In layperson's terms, it helps you replace the value of this inside a function with whatever value you want. Apply is very similar to the call function. The only difference is that in apply you can pass an array as an argument list. Bind is a function that helps you create another function that you can execute later with the new context of this that is provided. Examples:- let name1 = { firstName : "Fahad" , lastName : "C" , printFullName : function () { console . log ( this . firstName + " " + this . lastName ); }, }; name1 . printFullName (); let name2 = { firstName : "Schin" , lastName : "Tendulkar" , }; // Function borrowing name1 . printFullName . call ( name2 ); // Another example const name3 = { firstName : "John" , lastName : "Doe" , }; let printFullName = function () { conso...