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
// 创建一个类functionStudent(name,age){this.name=name;this.age=age;}// 创建原型Student.prototype.info=function(){console.log('My name is '+this.name+' and my age is '+this.age);};// C.prototype == new C().__proto_ C.prototype == Object.getPrototypeOf(new C())vars=newStudent('dreamapple',22);s.info();// My name is dreamapple and my age is 22console.log(Student.prototype===s.__proto__);// trueconsole.log(Student.prototype===Object.getPrototypeOf(s));// true