interview-answe icon indicating copy to clipboard operation
interview-answe copied to clipboard

189.重新设置构造函数,让constructor保持不可枚举。

Open webVueBlog opened this issue 4 years ago • 1 comments

[js]

webVueBlog avatar Apr 18 '20 09:04 webVueBlog

Object.defineProperty(Person.prototype, "constructor", {
 enumerable: false,
 value: Person
});

webVueBlog avatar Apr 18 '20 10:04 webVueBlog