- Clone the repository to your local development environment https://github.com/simple-statistics/simple-statistics
git checkout
to tagv7.7.2
The mean()
function does not raise an error for null
values in sample, nor is there a note in the documentation
specifying this.
Here's an example of where I realized this:
const ss = require("simple-statistics");
var x = [null, 30, null];
console.log(ss.mean(x));
# which returns: 10
When passing in NaN
, nulls, strings, or undefined values to the function, the result should be NaN
.