Safari is 65,535. That is, the ushort to store (2 bytes 16 1). More is ignored.
The other browsers are at least Int. MaxValue. It is said that Firefox even uses long to maintain real parameters.
Other browsers may be int or maybe uint. This doesn't matter. After all we know the bottleneck in 65535.
Based on the above basis. You can consider using [].push.apply (a,b) instead of A=a.concat (b) when connecting arrays;
We just need to be aware that B's length cannot exceed 65535 for safari OK.
The problem with concat is to generate a new array and traverse A and B two arrays, and then put the elements a and b in turn.
var count = 100000, a = [1,2,3], b = [4,5,6], r = [], I, D;
d = new Date;
for (i = count; i--;) {
A.concat (b);
}
R[0] = new date-d;
d = new Date;
for (i = count; i--;) {
R.push.apply (A,B);
A = [1,2,3];
}
R[1] = new date-d;
Alert (R);
It can be concluded that even the IE6 chrome2 Safari 3 Firefox 2, an old browser push, is also a triumph, with individual browsers removing //a = [1,2,3]; the annotation section. Efficiency is better than concat. Chrome7 Dev and Safari 5.