Created
July 10, 2020 11:42
-
-
Save 11ma/82eedf0a2939ea8b9be924955fd616f6 to your computer and use it in GitHub Desktop.
call, apply, bind
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
call, apply, bind are methods functions have access to. | |
The bind() method makes a copy of the function attached to it. Whatever object you pass to it is what the "this" points to by reference. | |
The call() takes the object "this" will point to as a parameter. Unlike bind(), call() doesn't make a copy of the function, it executes the function. | |
The apply() also takes the object "this" will point to as a parameter, smiliar to the call, but it takes the rest of its values as an array. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment