摘要: FunctionFunction.prototype.method = function (name, func) { this.prototype[name] = func; //此时this为Function,与Function.prototype形成了环,摆脱静态方法的局限。 return t... 阅读全文
posted @ 2015-03-22 16:37 bugong 阅读(182) 评论(0) 推荐(0) 编辑
摘要: Stringstring.charAt(pos); //返回字符串中pos位置处的字符。如果pos小于0或大于等于string.length返回空字符串。模拟实现:Function.prototype.method = function (name, func) { this.prototype[n... 阅读全文
posted @ 2015-03-22 16:36 bugong 阅读(253) 评论(0) 推荐(0) 编辑
摘要: Arrayarray.concat(item...); //产生一个新数组如果item,是一个数组,那么它的每个元素会被分别添加(浅复制,只解析一层)。示例:var a = [1, 3, 4];var b = [5, 8];var c = a.concat(b, true, false);conso... 阅读全文
posted @ 2015-03-22 09:55 bugong 阅读(272) 评论(0) 推荐(0) 编辑