function A(){ this.name = 'hellow word'; } Object.defineProperties( A.prototype,{ doSomething2 : { value: function(parm){ console.log(parm) }, enumerable: true, configurable: true, writable: true } }) var a2 = new A() a2.doSomething2();
function A(){ this.name = 'hellow word'; } Object.defineProperties( A.prototype,{ doSomething2 : { value: function(parm){ console.log(parm) }, enumerable: true, configurable: true, writable: true } }) var a2 = new A() a2.doSomething2();