function Obj1(name){ this.__proto__={ Name:name, getName:function(){ alert(this.Name); } }
Only functions has the property prototype. You need to set the prototype on the function self.
function Obj2(name){ this.name = name; } Obj2.prototype={ getName:function(){ alert(this.Name); } };