1
0
mirror of https://github.com/kamranahmedse/developer-roadmap.git synced 2025-08-30 04:30:01 +02:00

Update 106-explicit-binding.md (#2015)

This commit is contained in:
Yash bhanushali
2022-10-05 04:59:20 +05:30
committed by GitHub
parent 9787b58dd7
commit a494e837d1

View File

@@ -1 +1,11 @@
# Explicit binding
# Explicit binding
In this method, you can force a function to use a certain object as its this. Explicit Binding can be applied using call(), apply(), and bind().
call(): Pass in the required object as the first parameter during the function call. The actual parameters are passed after the object.
apply(): Similar to call() with a difference in the way the actual arguments are passed. Here, the actual arguments are passed as an array.
bind(): In this method, you create a new function with a fixed this. These types of functions created using bind() are commonly known as bound functions.
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://medium.com/swlh/javascript-this-ac28f8e0f65d'>Explicit Binding</BadgeLink>