Prototype原型模式
摘要:
通过构造函数的弊端引出原型概念先看一个一只猫的构造函数function Cat(name,color){ this.name = name; this.color = color; this.type = "猫科动物"; this.eat = function(){alert... 阅读全文
posted @ 2014-11-18 19:37 幺蛾子多 阅读(276) 评论(0) 推荐(0)
posted @ 2014-11-18 19:37 幺蛾子多 阅读(276) 评论(0) 推荐(0)