function F(x) { if (this.constructor == F && !this.constructor.i) { this.constructor.i = 1; this.x = x; } return this.x; } var f = new F(3), obj = {x: 5}; alert(f.x); //3 alert(F.call(obj)); //5 alert(F.call(f)); //3