Calculates the median of a specified numeric property in an array of objects.
The type of objects in the array.
The array of objects.
The key whose numeric values will be used.
The median value, or NaN if no valid numbers are found.
const data = [{ a: 1 }, { a: 3 }, { a: 2 }];medianBy(data, 'a'); // Returns 2 Copy
const data = [{ a: 1 }, { a: 3 }, { a: 2 }];medianBy(data, 'a'); // Returns 2
Calculates the median of a specified numeric property in an array of objects.