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.
Example 1: In this example, we are passing two numbers in the lodash _.divide() method and print the result which is a quotient in the console.
Javascript
const _ = require( "lodash" );
let gfg = _.divide(1508, 4);
console.log(gfg)
|
Output:
377
Example 2: In this example, we are passing two numbers in the lodash _.divide() method and print the result which is a quotient in the console.
Javascript
const _ = require( "lodash" );
let gfg = _.divide(12, 5);
console.log(gfg)
|
Output:
2.4
Last Updated :
30 Oct, 2023
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...