Operators:
Javascript operators are used to assign values,perform operations and compare values.
- Arithmetic operators.
- Bitwise Operators
- Logical Operators
- comparison Operators
- String Operators
- Operator Precedence
1.Arithmetic operators
These are used to perform operations on numbers.
Arithmetic operators are
- + For Addition
- - For Subtrction
- * For Multiplication
- / For Division
- % For Modules
- ++ For Increment
- - - For Decrement
EX:
Code:
OUTPUT:
2.Assignment operators:
These operators are =, +=, -=, *=, /=, %=
Code:
OUTPUT:
3. Sting Operator:
we can concatenate two strings by using = operator.
Ex:
Code:
Code:
4.Comparison Operator:
comparison operators are ==,>=,<=,!=,!==,<,>
OUTPUT:
Logical Operators:
Logical operators are &&, ||,!=
EX:
Code:
OUTPUT: