摘要: 绑定构造函数在子类构造函数中使用Fatherconstructor.apply(this, arguments)eg://父类function People(name,age){ this.name = name; this.age = age; this.species = "h... 阅读全文
posted @ 2014-05-21 17:06 wishyouhappy 阅读(246) 评论(0) 推荐(0) 编辑
摘要: 浅拷贝浅拷贝函数:function copy(p){ var c = {}; for (var i in p){ c[i] = p[i]; } c.uber = p; return c;}测试:var People = { nation:'中国'};Pe... 阅读全文
posted @ 2014-05-21 16:50 wishyouhappy 阅读(461) 评论(0) 推荐(0) 编辑