Re: Numeric Array prototypes

2018-11-20 Thread Isiah Meadows
It doesn't work as well with larger collections. Personally, it makes most sense in a standard library module On Wed, Nov 21, 2018 at 00:43 Michael Luder-Rosefield < rosyatran...@gmail.com> wrote: > > Math.min() method doesn't work on Arrays right out of the box. > > No, but rest parameters

Re: Numeric Array prototypes

2018-11-20 Thread Michael Luder-Rosefield
> Math.min() method doesn't work on Arrays right out of the box. No, but rest parameters work: Math.min(...arr) is fine, and works with Sets too. On Wed, 21 Nov 2018 at 14:08 Isiah Meadows wrote: > Not sure these belong in the standard library itself. I could see max and > min being there

Re: Numeric Array prototypes

2018-11-20 Thread Isiah Meadows
Not sure these belong in the standard library itself. I could see max and min being there (these are very broadly useful), but the others, not so much. I'd also like both max and min accept an optional comparison callback of `(a, b) => a < b`. But the rest seem too narrowly useful IMHO. On Tue,

Numeric Array prototypes

2018-11-20 Thread Gbadebo Bello
The array object has no method for finding the minimum value of an array of numbers and the Math.min() method doesn't work on Arrays right out of the box. I'll have similar issues if i wanted to return the maximum number, the mean, mode, median or standard deviations in any array of numbers.