Advertisement
Guest User

Untitled

a guest
Nov 14th, 2019
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Test {
  2.   constructor(num) {
  3.     this.num = num;
  4.   }
  5.  
  6.   foo = () => {
  7.     return () => {
  8.       console.log(this);
  9.       console.log(this.num);
  10.     }
  11.   }
  12. }
  13.  
  14. test = new Test(100);
  15.  
  16. f = test.foo();
  17.  
  18. f();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement