DEV Community

Cover image for Javascript operators (part 1)
Esraa Refaat
Esraa Refaat

Posted on

Javascript operators (part 1)

Operators in Javascript has three categories:

1- unary operators
One operand
X

2- binary operators

Two operands
X Y

3- ternary operators
Three operands
X Y Z


unary operators :
increment
X++
decrement
X--
Keep in mind
prefix ++X
postfix X++

binary operators :

  • arthimatic operators : X+Y X-Y X*Y X/Y X%Y
  • assignment operators :
    X+=y ➡️ X=X+Y
    (-=)(*=)(+=)(/=)(%=)

  • comparison operators :
    (==) ( > ) ( < )

Top comments (0)