在学习原型链时,不太明白为什么dog.price会输出undefined,有大佬可以画图讲解一下吗
因为你的var tidy = new dog() 改变了this指向,new了一个实例,如果你不创建实例的话,他就是undefined