JS Operators
What's a JavaScript Operator?
The JavaScript Operator is a symbol which performs an operation for a value or a set of values or data.
Below are the types of JavaScript Operators:
- Assignment Operators
- Comparison Operators
- Arithmetic Operators
- Logical Operators
- Conditional Operators
Assignment Operators
The assignment operator is the basic = symbol.
e.g. let x = 3;
Comparison Operators
The comparison operators are:
> (greater than),
< (less than),
= (equal to),
!= (not equal to),
<= (less than or equal to),
>= (greater than or eaual to),
== (strictly equal to)
Arithmetic Operators
- + Add
- * Multiply
- - Sutract
- ** Expenential
- % Modulus
- -- Decrement
- ++ Increment
- / Divide
Logical Operators
The Logical Operators are:
|| (OR), && (AND), ! (NOT)
Example:
Conditional Operators
The JavaScript conditionals: if, else, and else if