Operators

Operators are used to perform operations on values. JavaScript has a number of different operators, including arithmetic operators, comparison operators, logical operators, and assignment operators.

Arithmetic Operators

Arithmetic operators are used to perform mathematical operations on values. The most common arithmetic operators are:

  • Addition: +
  • Subtraction:
  • Multiplication: *
  • Division: /
  • Modulus: %

The following code shows an example of how to use arithmetic operators:


		
ADVERTISEMENT
ADVERTISEMENT