Advertisement
Guest User

Untitled

a guest
Jul 27th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. var test = function(){};
  2. testProto = test.prototype;
  3.  
  4. testProto.a = function(){
  5. return this;
  6. }
  7.  
  8. testProto.b = function(){
  9. return this;
  10. }
  11. var idx = 0;
  12. testProto.c = function(){
  13. console.log('call -> ' + (idx++))
  14. var self = this;
  15. setInterval(self.c.bind(self) , 1000)
  16. }
  17.  
  18.  
  19. var test = new test();
  20. test.a().b().c();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement