Additional Math functions
C. Scott Ananian
ecmascript at cscott.net
Wed Apr 29 16:04:21 UTC 2015
Aren't there limits to the number of arguments you can pass to a ES
function before getting a stack overflow?
I've gotten in trouble trying to abuse the `arguments` array like this
before, for example `Math.max.apply(Math, someVeryLargeArray)`.
Empirically, with iojs 1.8.1:
> Math.max.apply(Math, new Array(100000))
> Math.max.apply(Math, new Array(1000000))
RangeError: Maximum call stack size exceeded
arguments on the heap to avoid this problem, but I don't think that's part
of the ES6 spec. Am I mistaken?
If we're going to add math functions to the standard library, my vote would
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss