JavaScript has several operators that can be classified into different categories. Here is a list of some commonly used operators in JavaScript:
1. Arithmetic Operators:- Addition: +
- Subtraction: -
- Multiplication:
- Division: /
- Modulus: %
- Increment: ++
- Decrement: --
2. Assignment Operators:- Assignment: =
- Addition assignment: +=
- Subtraction assignment: -=
- Multiplication assignment: =
- Division assignment: /=
- Modulus assignment: %=
3. Comparison Operators:- Equal to: ==
- Not equal to: !=
- Strict equal to: ===
- Strict not equal to: !==
- Greater than: >
- Less than: <
- Greater than or equal to: >=
- Less than or equal to: <=
4. Logical Operators:- Logical AND: &&
- Logical OR: ||
- Logical NOT: !
5. Bitwise Operators:- Bitwise AND: &
- Bitwise OR: |
- Bitwise XOR: ^
- Bitwise NOT: ~
- Left shift: <<
- Right shift: >>
- Unsigned right shift: >>>
6. Ternary Operator:- Conditional (Ternary) Operator: ? :
7. Unary Operators:- Unary plus: +
- Unary minus: -
- Logical NOT: !
8. String Operators:- Concatenation: +
9. Type Operators:- typeof: Returns a string indicating the type of a variable
- instanceof: Checks if an object belongs to a specific class
These are just some of the many operators available in JavaScript. Each operator has a specific purpose and can be used in different scenarios to perform various operations.
Post a Comment