Operators
Binary operators comprise
Arithmetic Operators
- '+' : addition
- '-': subtraction
- '*': multiplication
- '/': float division
- '%': modulo
Bitwise Operators
- '&': bitwise AND
- '|': bitwise OR
- '^': bitwise exclusive OR
- '>>': right shift
- '<<': left shift
Relational Operators
- '==': equality
- '!=': inequality
- '<': less than
- '>': greater than
- '⇐': less or equal
- '>=': greater or equal
Logical Operators
- '&&': and
- '||': or
- '!': not
Conditional(ternary) Operator
condition? trueValue:falseValue
Optional Chaining
(?.)
The optional chaining (?.) operator accesses an object’s property or calls a function. If the object’s property or function is undefined or null, the expression evaluates to undefined instead of throwing an error.
Updated 6 months ago