Multiplication (*)
The multiplication operator (*
) produces the product of the operands.
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
Syntax
Operator: x * y
Examples
Multiplication using numbers
2 * 2 // 4
-2 * 2 // -4
Multiplication with Infinity
Infinity * 0 // NaN
Infinity * Infinity // Infinity
Multiplication with non-numbers
'foo' * 2 // NaN
Specifications
Specification |
---|
ECMAScript (ECMA-262) The definition of 'Multiplication operator' in that specification. |
Browser compatibility
BCD tables only load in the browser