My journal for Code Fellows
JavaScript has both Binary and Unary Operators
Binary example - operand1 operator operand2
x * y
Unary example - operator operand
x++ or x–
const
, let
, and var
statements as it often does not workAssignment | x = f() | x = f() | ||||
Addition assignment | x += f() | x = x + f() | ||||
Subtraction assignment | x -= f() | x = x - f() | ||||
Multiplication assignment | x *= f() | x = x * f() | ||||
Division assignment | x /= f() | x = x / f() | ||||
Remainder assignment | x %= f() | x = x % f() | ||||
Exponentiation assignment | x **= f() | x = x ** f() | ||||
Left shift assignment | x «= f() | x = x « f() | ||||
Right shift assignment | x »= f() | x = x » f() | ||||
Unsigned right shift assignment | x »>= f() | x = x »> f() | ||||
Bitwise AND assignment | x &= f() | x = x & f() | ||||
Bitwise XOR assignment | x ^= f() | x = x ^ f() | ||||
Bitwise OR assignment | x | = f() | x = x | f() | ||
Logical AND assignment | x &&= f() | x && (x = f()) | ||||
Logical OR assignment | x | = f() | x | (x = f()) | ||
Logical nullish assignment | x ??= f() | x ?? (x = f()) |
Equal (==) | Returns true if the operands are equal. |
Not equal (!=) | Returns true if the operands are not equal. |
Strict equal (===) | Returns true if the operands are equal and of the same type. See also Object.is and sameness in JS. |
Strict not equal (!==) | Returns true if the operands are of the same type but not equal, or are of different type. |
Greater than (>) | Returns true if the left operand is greater than the right operand. |
Greater than or equal (>=) | Returns true if the left operand is greater than or equal to the right operand. |
Less than (<) | Returns true if the left operand is less than the right operand. |
Less than or equal (<=) | Returns true if the left operand is less than or equal to the right operand. |
for
Statementswhile
Statements