multiply()
multiply(
multiplier,multiplicand):number
Multiplies two numbers.
DEPRECATED
Use the * operator directly instead.
Parameters
multiplier: number
The first number in a multiplication.
multiplicand: number
The second number in a multiplication.
Returns: number
The product.
See Also
Since
2.0.0
Also known as
multiply (Lodash, Ramda) · ❌ (es-toolkit, Remeda, Radashi, Effect, Modern Dash, Antfu)
Example
// ❌ Deprecated approach
multiply(6, 4); // => 24
// ✅ Recommended approach
6 * 4; // => 24
How it works?
Multiplies two numbers.
Deprecated: Use the * operator directly.
Native Equivalent
// ❌ multiply(6, 4)
// ✅ 6 * 4
Use Cases
Multiply numbers 📌
Multiply two numbers.
a * b;
Scale values
Apply scaling factor.
const scaled = value * scaleFactor;
const withTax = price * 1.2;