JavaScript * Multiplication Operator
The multiplication operator (*) multiplies two numbers.
Description
The multiplication operator * returns the product of its operands, converting them to numbers if needed. Multiplying by Infinity gives Infinity (or NaN when multiplied by 0). Decimal results can show floating point rounding, such as 0.1 * 3.
Like the other arithmetic operators except +, multiplication converts both operands to numbers first, so '3' * '4' gives 12 and a non-numeric string gives NaN. Multiplying two BigInts gives a BigInt, but mixing a BigInt with a regular number throws a TypeError.
It has higher precedence than addition and subtraction, so 2 + 3 * 4 is 14; use parentheses when you want a different order. For repeated multiplication, the exponentiation operator ** is shorter, and x *= y multiplies a variable in place. Common uses include scaling values, calculating areas and converting units, such as seconds * 1000 for milliseconds.
Properties
- Operator
*- Category
- Arithmetic
- Precedence
- 12 (1 is lowest, 18 is highest)
- Associativity
- left-to-right
Syntax
x * yExample
Browser Support
The following information will show you the current browser support for the * operator. Hover over a browser icon to see the version that first introduced support for this operator.
Desktop





Tablets & Mobile





