How to use Lodash _.divide() Method In Javascript
In this example, we are using the Lodash _.divide() method that return the result of the division of two numbers.
Example: This example shows the implemetation of the above-explained approach.
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
Division in JavaScript
In every programming language, the operation of division is used often. The division operator (/) is used in JavaScript to divide integers. You may use the division operator or a predefined JavaScript technique that treats every number as an integer to divide two values.
Use the techniques listed below to divide two numbers:
Table of Content
- Division (/) Operator
- JavaScript parseInt() Method
- Using math library in JavaScript
- Using Bitwise Operator