Implement a function mean(array) that returns the mean (also known as the average) of the values in array, an array of numbers.
mean(array)
array
(Number): Returns the mean of the values in array.
mean([4, 2, 8, 6]); // => 5mean([1, 2, 3, 4]); // => 2.5mean([1, 2, 2]); // => 1.6666666666666667
The function should return NaN if array is empty.
NaN
mean([]); // => NaN
_.mean
console.log()