摘要: switch结构不利于代码重用,往往可以用对象形式重写。 <!--[if !supportLists]-->ü <!--[endif]-->typeof运算符 <!--[if !supportLists]-->ü <!--[endif]-->instanceof运算符 <!--[if !suppor 阅读全文
posted @ 2016-05-23 11:35 你是me的only 阅读(434) 评论(0) 推荐(0)
摘要: 原型链 function SuperType(){ } SuperType.prototype.name="name"; SuperType.prototype.sayName= function () { return this.n... 阅读全文
posted @ 2015-04-19 17:58 你是me的only 阅读(175) 评论(0) 推荐(0)
摘要: 工厂模式function factorial(name,age){ var o=new Object(); o.name=name; o.age=age; o.sayName= function () { alert(th... 阅读全文
posted @ 2015-04-17 16:09 你是me的only 阅读(110) 评论(0) 推荐(0)