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