divide()
divide(
dividend,divisor):number
Divides two numbers.
DEPRECATED
Use the / operator directly instead.
Parametersโ
dividend: numberโ
The first number in a division.
divisor: numberโ
The second number in a division.
Returns: numberโ
The quotient.
See Alsoโ
Sinceโ
2.0.0
Also known asโ
divide (Lodash, Ramda) ยท โ (es-toolkit, Remeda, Radashi, Effect, Modern Dash, Antfu)
Exampleโ
// โ Deprecated approach
divide(6, 4); // => 1.5
// โ
Recommended approach
6 / 4; // => 1.5
How it works?โ
Divides two numbers.
Deprecated: Use the / operator directly.
Native Equivalentโ
// โ divide(6, 4)
// โ
6 / 4
Use Casesโ
Divide numbers ๐โ
Divide two numbers.
a / b;
Calculate ratioโ
Calculate proportions.
const ratio = part / total;
const percentage = (count / total) * 100;