You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
functionDog(name){this.name=name}Dog.prototype.bark=function(){console.log('wang wang')}Dog.prototype.sayName=function(){console.log('my name is '+this.name)}function_new(){// code}letsanmao=_new(Dog,'三毛')sanmao.bark();// => 'wang wang'sanmao.sayName();// => 'my name is 三毛'console.log(sanmaoinstanceofDog)// true
new 构造函数
new Person() 过程中发生了什么
(阿里)面试题,实现一个 _new(),得到预期的结果
The text was updated successfully, but these errors were encountered: