If you don't have to deal with large arrays (more than 100000 elements), then this approach works fine.
However if the array is large, please bear in mind that JavaScript runtimes have a limitation on the number of arguments that you can pass to a function. Yes, this include spread parameters.
If you pass more arguments than the limit, “Maximum call stack size exceeded” errors happen.
It works good on Firefox and IE, but on Chrome I always get Maximum call stack size exceeded errors... my current array has 221954 elements, and that's not my…
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
If you don't have to deal with large arrays (more than 100000 elements), then this approach works fine.
However if the array is large, please bear in mind that JavaScript runtimes have a limitation on the number of arguments that you can pass to a function. Yes, this include spread parameters.
If you pass more arguments than the limit, “Maximum call stack size exceeded” errors happen.
Chrome: How to solve "Maximum call stack size exceeded" errors on Math.max.apply( Math, array )
I have to find the maximum and minimum value of very huge arrays. For this I'm using
It works good on Firefox and IE, but on Chrome I always get
Maximum call stack size exceeded
errors... my current array has 221954 elements, and that's not my…