正文分享一个Object.defineProperties 定义一个在原对象可读可写的方法IP云V管理员/2022-11-29/4 阅读 11/29提示:扫一扫查出行【扫一扫了解最新限行尾号】复制提示 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();