← Back to Roadmap

Arithmetic Operators

Easy

In plain terms

Arithmetic operators perform math: + (add/concatenate), - (subtract), * (multiply), / (divide), % (remainder), ** (exponent). + with strings concatenates them.

What you need to know

  • +, -, *, /, %, **
  • Unary + and -
  • NaN from invalid operations

Try it yourself

Copy the code below and run it in your browser console or a code editor:

5 + 3;   // 8
5 - 3;   // 2
5 * 3;   // 15
10 / 3;  // 3.333...
10 % 3;  // 1 (remainder)
2 ** 3;  // 8 (exponent)

'Hello' + ' ' + 'World';  // "Hello World"
'5' + 3;  // "53" (string concatenation)

Learn more

Dive deeper with these trusted resources: