Operators in JavaScript
Operators are symbols that perform operations on operands. JavaScript supports various types of operators, including arithmetic, assignment, comparison, logical, and more. Let's explore some common operators used in JavaScript:
Video Explanation

1. Arithmetic Operators:
Arithmetic operators are used to perform mathematical calculations.
Addition (+):
The addition operator is used to add two operands.
let sum = 10 + 5; // sum = 15
Subtraction (-):
The subtraction operator is used to subtract the second operand from the first.
let difference = 20 - 8; // difference = 12
Multiplication (*):
The multiplication operator is used to multiply two operands.
let product = 5 * 4; // product = 20
Division (/):
The division operator is used to divide the first operand by the second.
let quotient = 50 / 10; // quotient = 5
Modulus (%):
The modulus operator returns the remainder of the division operation.
let remainder = 15 % 4; // remainder = 3
2. Assignment Operators:
Assignment operators are used to assign values to variables.
Assignment (=):
The assignment operator assigns the value on the right to the variable on the left.
let x = 10; // x = 10
Addition Assignment (+=):
The addition assignment operator adds the value on the right to the variable's current value.
let y = 5;
y += 3; // y = 8
Subtraction Assignment (-=):
The subtraction assignment operator subtracts the value on the right from the variable's current value.
let z = 10;
z -= 2; // z = 8
3. Comparison Operators:
Comparison operators are used to compare two values.
Equal (==):
The equal operator checks if two values are equal. But it does not consider the data type.
let isEqual = 5 == '5'; // isEqual = true
Strict Equal (===):
The strict equal operator checks if two values are equal and of the same data type.
let isStrictEqual = 5 === '5'; // isStrictEqual = false
Not Equal (!=):
The not equal operator checks if two values are not equal.
let isNotEqual = 10 != 5; // isNotEqual = true