- Assignment operators - An assignment operator assigns a value to its left operand based on the value of its right operand.
int x = 10;
- Arithmetic Operators - Arithmetic operators are used to perform arithmetic operations on the operands. The following operators are known as JavaScript arithmetic operators.
int x = 10;
x += 5;
- Comparison Operators - The JavaScript comparison operator compares the two operands.
age = Number(age);
if (isNaN(age)) { voteable = "Input is not a number"; }
else { voteable = (age < 18) ? "Too young" : "Old enough";
}
- Bitwise Operators - The bitwise operators perform bitwise operations on operands.
1.And (&)
let x = 5 & 1;
2.OR (|)
let x = 5 | 1;
3.XOR (^)
let x = 5 ^ 1;
4.NOT (~)
let x = ~5;