Lodash _.minBy() Method Last Updated : 02 Sep, 2024 Comments Improve Suggest changes Like Article Like Report Lodash _.minBy() method is used to compute the minimum value from the original array by iterating over each element in the array using the Iteratee function. It is almost the same as the _.min() function.Syntax:_.minBy(array, [iteratee = _.identity]);Parameters:array: It is the array that the method iterates over to get the minimum element.iteratee: It is the function that is invoked for every element in the array.Return Value: This method returns the minimum element.Example 1: In this example, we are printing the minimum value of the given array by the use of the _.minBy() method. JavaScript // Requiring the lodash library const _ = require("lodash"); // Original array let arr = [{ 'n': 4 }, { 'n': 2 }, { 'n': 6 }]; // Use of _.minBy() method let min_val = _.minBy(arr, function (o) { return o.n; }); // Printing the output console.log(min_val); Output:{ 'n': 2 }Example 2: In this example, we are printing the minimum value of the given array by the use of the _.minBy() method. JavaScript // Requiring the lodash library const _ = require("lodash"); // Original array let arr = [{ 'n': 10 }, { 'n': 5 }, { 'n': 3 }, { 'n': 12 }]; // Use of _.minBy() method let min_val = _.minBy(arr, 'n'); // Printing the output console.log(min_val); Output:{ 'n': 3 } Comment More infoAdvertise with us S sanjoy_62 Follow Improve Article Tags : JavaScript Web Technologies JavaScript-Lodash Similar Reads Lodash _.add() Method Lodash _.add() method is used to add two numbers. Syntax:_.add(augend, addend);Parameters:augend: This parameter holds the first number in addition.addend: This parameter holds the second number in addition.Return Value: This method returns the result of adding two numbers. Example 1: In this exampl 1 min read Lodash _.ceil() Method Lodash _.ceil() method is used to compute numbers rounded up to precision.Syntax:_.ceil(number, [precision = 0]);Parameters: number: This parameter holds the number to round up.[precision=0]: This parameter holds the precision to round up to.Return Value: This method returns the rounded-up number.Ex 2 min read Lodash _.divide() Method Lodash _.divide() method is used to divide two numbers.Syntax:_.divide(dividend, divisor);Parameters: dividend: This parameter holds the first number in a division.divisor: This parameter holds the second number in a division.Return Value: This method returns the quotient after dividing two numbers. 2 min read Lodash _.floor() Method Lodash _.floor() method is used to compute numbers rounded down to precision means it rounded down to the floor value.Syntax:_.floor(number, [precision = 0])Parameters: This method accepts two parameters as mentioned above and described below:number: This parameter holds the number to round down.[pr 2 min read Lodash _.max() Method Lodash _.max() method is used to find the maximum element from the array. If the array is empty then undefined is returned.Syntax:_.max( array );Parameters:array: It is the array that the method iterates over to get the maximum element.Return Value: This method returns the maximum element from the a 2 min read Lodash _.maxBy() Method Lodash _.maxBy() method is used to compute the maximum value from the original array by iterating over each element in the array using the Iteratee function. It is almost the same as the _.max() function.Syntax:_.maxBy( array, [iteratee = _.identity] );Parameters: array: It is the array that the met 3 min read Lodash _.mean() Method Lodash_.mean() method is used to find the mean of the values in the array.Syntax:_.mean( array )Parameters: This method accepts a single parameter as mentioned above and described below:array: It is the array that the method iterates over to get the mean of all the values.Return Value: This method r 3 min read Lodash _.meanBy() Method Lodash _.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 the _.mean() function.Syntax:_.meanBy(array, [iteratee = _.identity]);Parameters: array: It is the array that the metho 2 min read Lodash _.min() Method Lodash _.min() method is used to find the minimum element from the array. If the array is empty then undefined is returned.Syntax:_.min(array);Parameters: array: It is the array that the method iterates over to get the minimum element.Return Value: This method returns the minimum element from the ar 2 min read Lodash _.minBy() Method Lodash _.minBy() method is used to compute the minimum value from the original array by iterating over each element in the array using the Iteratee function. It is almost the same as the _.min() function.Syntax:_.minBy(array, [iteratee = _.identity]);Parameters:array: It is the array that the method 3 min read Like