Arithmetic operators are used for performing mathematical operations.
%: Modulus (remainder)
Comparison operators are used to compare values.
==: Equal to (equality, without type checking)
===: Strict equal to (equality with type checking)
!=: Not equal to (inequality, without type checking)
!==: Strict not equal to (inequality with type checking)
>: Greater than
<: Less than
>=: Greater than or equal to
<=: Less than or equal to
Logical operators are used to combine or modify Boolean values.
&&: Logical AND (true if both operands are true)
||: Logical OR (true if at least one operand is true)
!: Logical NOT (inverts the Boolean value)
Assignment operators are used to assign values to variables.
=: Assigns the value on the right to the variable on the left
+=: Adds the right operand to the left operand and assigns the result to the left operand
-=: Subtracts the right operand from the left operand and assigns the result to the left operand
*=: Multiplies the left operand by the right operand and assigns the result to the left operand
/=: Divides the left operand by the right operand and assigns the result to the left operand
%=: Computes the modulus of the left operand and the right operand and assigns the result to the left operand
Bitwise operators perform operations on binary representations of numbers.
&: Bitwise AND
|: Bitwise OR
^: Bitwise XOR (exclusive OR)
~: Bitwise NOT (complement)
<<: Left Shift
>>: Right Shift
>>>: Unsigned Right Shift
The conditional operator is used to assign a value to a variable based on a condition.
condition ? value1 : value2: If the condition is true,
value1is assigned; otherwise,
typeof operator is used to determine the type of a value or variable.
typeof x: Returns a string indicating the data type of
instanceof operator is used to check if an object is an instance of a particular class or constructor.
object instanceof constructor: Returns
objectis an instance of
in operator is used to check if a property exists in an object.
property in object: Returns
propertyis found in