Advertisement
Guest User

Untitled

a guest
Dec 2nd, 2014
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function Class() {
  2.      this.x = 1;
  3.     this.generate = function(n) {
  4.         var s = this.x;
  5.         this.x += n;
  6.         return s;
  7.     }
  8. }
  9.  
  10. var obj = new Class();
  11. alert( obj.generate(17) );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement