Multiplication operation

Learn how to multiply two numeric values.

The multiplication operation multiplies two numeric values and returns the product.

To use the multiplication operator, place a * sign between two numeric values:

/*<operand>*/ * /*<operand>*/
Try in Playground

For a more natural reading, you can alternatively write:

/*<operand>*/ times /*<operand>*/
Try in Playground

Here is a practical example:

Because the multiplication operation is commutative, the order of the operands does not matter. This is confirmed by the expression below:

2 * 3 is equal to 3 * 2
Try in Playground

Note that multiplication has higher precedence than addition and subtraction. This means that multiplication is performed before those operations, as shown below:

2 + 3 * 4 // 14, not 20
Try in Playground