摘要:
先上图:代码演示:var arr=[];arr.push('tom','james','alen','peter');console.log(arr.length);//这里toString()一下,不然用console.log()就看不到效果了console.log(arr.toString());console.log('----------------');//popconsole.log('pop:'+arr.pop());console.log(arr.length);console.lo 阅读全文
摘要:
//自定义高效的处理字符串拼接的类function StringBuffer () { this._strings_ = new Array();}StringBuffer.prototype.append = function(str) { this._strings_.push(str);};StringBuffer.prototype.toString = function() { return this._strings_.join("");};//定义结束var d1 = new Date();var str = "";for (var i=0 阅读全文
摘要:
阅读全文