Guest User

Untitled

a guest
Dec 12th, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. class Foo {
  2.  
  3. constructor() {
  4. this.func = null;
  5. }
  6.  
  7. a() {
  8. let self = this;
  9. this.func = function() {
  10. console.log(self);
  11. console.log(this);
  12. }
  13. let testFunc = function() {
  14. console.log('in test func')
  15. console.log(this);
  16. }
  17. testFunc();
  18. }
  19.  
  20. b() {
  21. console.log('in b')
  22. this.func();
  23. }
  24. }
  25.  
  26. let x = new Foo();
  27. x.a();
  28. x.b();
Add Comment
Please, Sign In to add comment