Open In App

Lodash Math Complete Reference

Improve
Improve
Like Article
Like
Save
Share
Report

Lodash is a JavaScript library that works on the top of underscore.js. Lodash helps in working with arrays, strings, objects, numbers, etc. It provides us with various inbuilt functions and uses a functional programming approach which makes coding in javascript easier to understand because instead of writing repetitive functions, tasks can be accomplished with a single line of code.

Methods

Description

_.add() It is used to add two numbers.
_.ceil() It is used to compute number rounded up to precision.
_.divide() It is used to divide two numbers.
_.floor() It is used to compute numbers rounded down to precision means it rounded down to the floor value.
_.max() It is used to find the maximum element from the array.
_.maxBy() It is used to compute the maximum value from the original array by iterating over each element.
_.mean() It is used to find the mean of the values in the array.
_.meanBy() It is used to compute the mean value from the original array by iterating over each element.
_.min() It is used to find the minimum element from the array.
_.minBy() It is used to compute the minimum value from the original array by iterating over each element.
_.multiply() It is used to multiply the two given numbers in the parameters.
_.round() It is used to compute number rounded to precision.
_.subtract() It is used to subtract two numbers.
_.sum() It is used to find the sum of the values in the array.
_.sumBy() It is used to compute the sum from the original array by iterating over each element.

Last Updated : 26 Jul, 2023
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads