Skip to content
Related Articles

Related Articles

Lodash _.divide() Method

View Discussion
Improve Article
Save Article
  • Last Updated : 01 Sep, 2020
View Discussion
Improve Article
Save Article

The _.divide() method is used to divide two numbers.

Syntax:

_.divide(dividend, divisor)

Parameters: This method accepts two parameters as mentioned above and described below:

  • 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 divide two numbers.

Example 1: Here, const _ = require(‘lodash’) is used to import the lodash library into the file.

Javascript




// Requiring the lodash library  
const _ = require("lodash"); 
   
// Use of _.divide() method 
let gfg = _.divide(1508, 4);
         
// Printing the output  
console.log(gfg)


Output:

377

Example 2:  

Javascript




// Requiring the lodash library  
const _ = require("lodash"); 
   
// Use of _.divide() method 
let gfg = _.divide(12, 5);
         
// Printing the output  
console.log(gfg)


Output:

2.4
My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!