Javascript - Operators


Arthmetic

Operator Description
+ Addition
- Subtraction
* Multiplication
** Exponentation
/ Division
% Mod
++ Increment
-- Decrement

Comparison

Operator Description
== Equal to, does not check type
=== Equal value and equal type
!= Not equal, does not check type
!== Not equal value or not equal type
> Greater than
< Less than
>= Greater than or equal to
<= Less than or equal to
?: Ternary operator

Logical

Operator Description
&& And
|| Or
! Not

Type

Operator Description Example
typeof Returns the type of a variable
typeof str_var; // "string"
instanceof Returns true if an object is an instance of an object type
auto instanceof Car; // true