Lodash _.meanBy() Method
The _.meanBy() method is used to compute the mean value from the original array by iterating over each element in the array using the Iteratee function. It is almost the same as _.mean() function.
_.meanBy( array, [iteratee = _.identity] )
Parameters: This method accepts two parameters as mentioned above and described below:
- array: It is the array that the method iterates over to get the mean of all the elements.
- iteratee: It is the function that is invoked for every element in the array.
Return Value: This method returns the mean value of the array.