Mark As Completed Discussion

Operators and Expressions

In JavaScript, operators are symbols that perform operations on operands. Expressions are combinations of variables, values, and operators that produce a new value.

Arithmetic Operators

Arithmetic operators are used to perform mathematical operations. Here are the common arithmetic operators in JavaScript:

  • Addition (+): Adds two operands together.
  • Subtraction (-): Subtracts the second operand from the first operand.
  • Multiplication (*): Multiplies two operands together.
  • Division (/): Divides the first operand by the second operand.
  • Modulus (%): Returns the remainder when the first operand is divided by the second operand.

Let's see some examples of using arithmetic operators:

JAVASCRIPT
OUTPUT
:001 > Cmd/Ctrl-Enter to run, Cmd/Ctrl-/ to comment