Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. 1. Default:
  2. `this` will be window.
  3.  
  4. 2. In a method:
  5. `this` will point to the object method is on.
  6. but once you go into another function,
  7. this will default back to window.
  8.  
  9. 3. Explicitly define `this`.
  10. Use `bind`, `apply`, `call`.
  11.  
  12. 4. When passing in a callback function, value of `this`
  13. inside callback depends on whether the outer function
  14. explicitly sets a `this` value. If not,
  15. it'll default to window.
  16.  
  17. 5. Constructors
  18. `this` points to the newly created object.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement