3 ms·
There's also "spread application" syntax in JS, like `Math.max(...list)`, but for many years browsers might permit it for small lists while crashing when suppli
by RodgerTheGreat 2y ago
There's also "spread application" syntax in JS, like `Math.max(...list)`, but for many years browsers might permit it for small lists while crashing when supplied with large lists; the compatibility tradeoffs and non-obvious behaviors of all these alternatives make the point pretty clearly, I think.
- geocar 2y agoHi John. Big lists are a good point. I didn't think of that. Cheers. function ta() { window.la = arguments.length; } for (var i = 1; i < 32; i++) { var list = new Array(1<<i); ta(...list) } la is only 65536 in Safari and Chrome; 262144 on Firefox. I have no idea what MSIE does. Using ta.apply(null,list) gives same results.