angus-c / just

A library of dependency-free JavaScript utilities that do just one thing.
https://anguscroll.com/just
MIT License
6.06k stars 209 forks source link

`just-standard-deviation` and `just-skewness` require 2 numbers in the array #561

Open harrisonlo opened 1 year ago

harrisonlo commented 1 year ago

In https://anguscroll.com/just/just-standard-deviation, using an array with one number returns the error message "less than one value was passed to standard deviation" but it should probably say "two values" or simply return 0. Same with skewness.

harrisonlo commented 1 year ago

Additionally, passing an array of equal numbers into skewness would return NaN, but should probably be 0.