优先执行有变量名的,再执行__proto__function Hero(){
this.name="你好",
this.sayMe=function(){
alert("this is nihao") } }
Hero.prototype.name="hello";
Hero.prototype.sayMe=function(){
alert("this is hello") }
var hero =new Hero();
console.log(hero)
console.log(hero.name)
console.log(hero.sayMe)
网友评论