Skip to content

Operators

Operator name Format
call function op1(op2)
array index op1[op2]
direct member op1.op2
postfix increment op++
postfix decrement op--
prefix increment ++op
prefix decrement --op
plus sign +op
minus sign -op
negation !op
generate new op1
multiplication op1 * op2
division op1 / op2
remainder op1 % op2
addition op1 + op2
subtraction op1 - op2
left shift op1 << op2
right shift op1 >> op2
less than op1 < op2
less than or equal op1 <= op2
greater than op1 > op2
greater than or equal op1 >= op2
equality op1 == op2
inequality op1 != op2
strict equality op1 === op2
strict inequality op1 !== op2
logical and op1 && op2
logical or op1 || op2
condition op1 ? op2 : op3
assignment op1 = op2
addition assignment op1 += op2
subtraction assignment op1 -= op2
multiplication assignment op1 *= op2
division assignment op1 /= op2
remainder assignment op1 %= op2
left shift assignment op1 <<= op2
right shift assignment op1 >>= op2
sequence op1, op2