1. function Foo()
  2. {
  3.     this.z = 1;
  4.     this.out = function(x, y) { return x + y + this.z }
  5. }
  6.  
  7. var bar = new Foo().out(2,3); // returns 6