Lesson 94 +15 XP

Operators Reference

Operators Reference

A quick reference of JavaScript operators.

Arithmetic

OperatorMeaning
+addition
-subtraction
*multiplication
/division
%remainder
**exponent
++increment
--decrement

Assignment

OperatorMeaning
=assign
+=add and assign
-=subtract and assign
*=multiply and assign
/=divide and assign

Comparison

OperatorMeaning
==loose equal
===strict equal
!=loose not equal
!==strict not equal
>, <greater/less than
>=, <=greater/less or equal

Logical

OperatorMeaning
&&AND
``OR
!NOT
??nullish coalescing

typeof and instance

typeof checks a value's type. instanceof checks if an object is an instance of a class.

TL;DR

  • Arithmetic: + - / % * ++ --.
  • Assignment shorthands: += -= *= /=.
  • Use === and !== for safe comparisons.
  • Logical: && || ! ??.