𝗝𝗮𝘃𝗮𝗦𝗰𝗿𝗶𝗽𝘁 𝗢𝗽𝗲𝗿𝗮𝘁𝗼𝗿𝘀
JavaScript operators are symbols. Use them to perform calculations. Use them to check values. Use them to modify variables.
Arithmetic operators do math.
- adds values
- subtracts values
- multiplies values
- / divides values
- % finds the remainder
- ** calculates power
- ++ increases a value by one
- -- decreases a value by one
Assignment operators store values in variables.
- = assigns a value
- += adds and assigns
- -= subtracts and assigns
- *= multiplies and assigns
- /= divides and assigns
Comparison operators return true or false.
- == compares values
- === compares value and type
- != checks if values differ
- !== checks if value or type differ
checks if greater
- < checks if less
= checks if greater or equal
- <= checks if less or equal
Logical operators check multiple conditions.
- && returns true if both are true
- || returns true if one is true
- ! flips the result
Bitwise operators handle memory in bits and bytes.
Source: https://dev.to/chandru_p_88e6b2526851d7b/java-script-operators-4khd