摘要:
prototype与[[prototype]]在有面象对象基础的前提下,来看一段代码:01//Animal构造函数02functionAnimal(name){03this.name = name;04}05//Animal原型对象06Animal.prototype = {07id:"Animal",08sleep:function(){09alert("sleep");10}11}1213vardog =newAnimal("旺才");14alert(dog.name);//旺才15alert(dog.id);//Animal16 阅读全文