๐ก bind( ) method:
๐ญ An object can borrow a method or function from another object using the bind( ) method. This is known as "function borrowing" in JavaScript.
๐ญ The bind( ) method creates a new function where "this" object refers to the parameter in the parentheses.
๐ญ An object can borrow a method or function from another object using the bind( ) method. This is known as "function borrowing" in JavaScript.
๐ญ The bind( ) method creates a new function where "this" object refers to the parameter in the parentheses.
๐ญ In this example (Next Tweet):
โ The "user1" object borrows a function called "fullName" using `bind( )` method.
โ And the first parameter of the ` bind( )` method is "user1", which refers to the "this" object, and the second one is for the function itself.
โ The "user1" object borrows a function called "fullName" using `bind( )` method.
โ And the first parameter of the ` bind( )` method is "user1", which refers to the "this" object, and the second one is for the function itself.
๐ญ Learn the `call( )` method from this thread:
๐ญ Learn the `apply( )` method from this thread:
That's all for now, we will meet in the next thread๐
๐ Follow Me @ATechAjay
For:
๐ Web Development
โจ JavaScript
๐ Writing Skill
๐ฅ Motivation
๐น Growth
โ But Not For Only Resources & Shitpost ๐
Thank you so much for staying to the end of this thread๐
๐ Follow Me @ATechAjay
For:
๐ Web Development
โจ JavaScript
๐ Writing Skill
๐ฅ Motivation
๐น Growth
โ But Not For Only Resources & Shitpost ๐
Thank you so much for staying to the end of this thread๐
Loading suggestions...