|
| 1 | +- [`this` Keyword](#this-keyword) |
| 2 | + - [`this` in function](#this-in-function) |
| 3 | + - [`this` in methods](#this-in-methods) |
| 4 | + - [`this` in event handlers](#this-in-event-handlers) |
| 5 | + - [`this` in arrow functions](#this-in-arrow-functions) |
| 6 | +- [Function Borrowing](#function-borrowing) |
| 7 | + - [Implicit Binding](#implicit-binding) |
| 8 | + - [Explicit Binding](#explicit-binding) |
| 9 | + - [🤝 bind()](#-bind) |
| 10 | + - [🤙 call()](#-call) |
| 11 | + - [👏 apply()](#-apply) |
| 12 | + |
1 | 13 | # `this` Keyword
|
2 | 14 |
|
3 | 15 | In simple terms, `this` keyword in JavaScript refers to an object upon which a function is invoked. This means that `this` can only be used in a function, or globally.
|
@@ -288,3 +300,5 @@ By using `apply()`, we're essentially invoking the `greet` function in the conte
|
288 | 300 |
|
289 | 301 | - By default, the methods of an object are implicitly bounded to the object itself, and we can access them using the dot (.) operator.
|
290 | 302 | - To access the methods of other objects, we need to explicitly bind them to the object using the `bind()`, `call()`, or `apply()` methods, with each one of them having its own use cases.
|
| 303 | + |
| 304 | +[<-- Previous [JavaScript Functions]](./10-JavaScript-Functions.md) <div style="text-align: right;"> [Next [Asnychronous JavaScript] -->](./12-Asynchronous-JavaScript.md)</div> |
0 commit comments