Additional Math functions

Eli Perelman eli at
Thu Oct 1 22:55:13 UTC 2015

In case it didn't come across, this is the thread I'm reviving:

Eli Perelman

On Thu, Oct 1, 2015 at 5:51 PM, Eli Perelman <eli at> wrote:

> Reviving this thread, doing any type of simple statistics is more verbose
> than it probably needs to be as calculating sums, averages, etc. makes most
> resort to Array reduction. I understand the need for methods such as
> `Math.hypot(...values)`, but for ECMAScript to evolve to be useful in
> statistics programming without needing to resort to R would definitely also
> be a nice-to-have. I'm sure there are many statistical functions you
> *could* add, but at a bare minimum, it would be useful:
> Math.sum(...values) or Math.summation(...values)
> Math.mean(...values) // Spelling out mean here is succinct while still
> intentional, instead of .avg
> Math.variance(...values)
> Math.stddev(...values)
> Obviously some of these can be computed from the results of others, but I
> think the convenience and intent of the methods, not to mention their wide
> usefulness outweigh the concern of Math bloat. Thoughts?
> P.S. Definitely not against even more core stats methods, but have to
> start somewhere. :)
> Eli Perelman
> Mozilla
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list