* refactor: clean to roadmap content * refactor: move shared helpers into scripts/lib
8 lines
625 B
Markdown
8 lines
625 B
Markdown
# Function Borrowing
|
|
|
|
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.
|
|
|
|
Visit the following resources to learn more:
|
|
|
|
- [@article@Function borrowing](https://medium.com/@ensallee/function-borrowing-in-javascript-4bd671e9d7b4)
|
|
- [@article@When would I use function borrowing](https://stackoverflow.com/questions/69892281/when-would-i-use-function-borrowing) |