Browsers can't handle that many arguments. See this snippet for example:
alert.apply(window, new Array(1000000000));
This yields RangeError: Maximum call stack size exceeded
which is the same as in your problem.
To solve that, do:
var arr = [];
for(var i = 0; i < 1000000; i++){
arr.push(Math.random());
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…