Skip to main content

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โ€‹

Multiplication (*) - MDN


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;