Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1. Default:
- `this` will be window.
- 2. In a method:
- `this` will point to the object method is on.
- but once you go into another function,
- this will default back to window.
- 3. Explicitly define `this`.
- Use `bind`, `apply`, `call`.
- 4. When passing in a callback function, value of `this`
- inside callback depends on whether the outer function
- explicitly sets a `this` value. If not,
- it'll default to window.
- 5. Constructors
- `this` points to the newly created object.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement