亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

javascript下高性能字符串連接StringBuffer類

 更新時(shí)間:2010年08月16日 23:38:14   作者:  
使用StringBuffer類比使用加號(hào)節(jié)省50%左右的時(shí)間,大家對(duì)于大數(shù)據(jù)的連接最好使用這個(gè)方法。
復(fù)制代碼 代碼如下:

function StringBuffer(){
this.__strings__ = new Array();
}
StringBuffer.prototype.append = function(str){
this.__strings__.push(str);
};
StringBuffer.prototype.toString = function(){
this.__strings__.join(" ");
};

其實(shí)上面的代碼,主要利用了js的數(shù)組原理實(shí)現(xiàn)。

相關(guān)文章

最新評(píng)論