标签:html http span size ret color com concat sans
1、循环插入
for (var i=0; i < b.length; i++) {
a.push( b[i] );
}
2、 a.push.apply(a,b);
b.unshift.apply( b, a );
例如: a.push.apply(a,[4,5,6]); 等同于 a.push(4,5,6);
3、 let c = a.concat( b );
4、ES5// `b` o
a; // [1,2,3,4,5,6,7,8,9,"foo","bar","baz","bam","bun","fun"]
// or `a` into `b`:
b = a.reduceRight( function(coll,item){
coll.unshift( item );
return coll;
}, b );
b; // [1,2,3,4,5,6,7,8,9,"foo","bar","baz","bam","bun","fun"]
5、避免数组最大长度限制
function combineInto(a,b) {
for (let i=0; i < a.length; i=i+5000) {
b.unshift.apply( b, a.slice( i, i+5000 ) );
}
}
相关文章:http://www.cnblogs.com/Being-a-runner-up/p/5627166.html
http://www.jb51.net/article/55204.htm
标签:html http span size ret color com concat sans
原文地址:http://www.cnblogs.com/ljbkyBlog/p/7127438.html