DEV Community

loading...
Cover image for Javascript operators  
(part 1)

Javascript operators (part 1)

Esraa
・1 min read

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 :
    (==) ( > ) ( < )

Discussion (0)