๐๐ฎ๐๐ฎ๐ฆ๐ฐ๐ฟ๐ถ๐ฝ๐ ๐ข๐ฝ๐ฒ๐ฟ๐ฎ๐๐ผ๐ฟ๐
Operators change your data. They build your expressions.
Arithmetic Operators
- Use + to add numbers.
- Use + to join strings.
- Use - to subtract.
- Use * to multiply.
- Use / to divide.
- Use % to find the remainder.
Assignment Operators
- Use these to set values.
- += adds and assigns.
- -= subtracts and assigns.
- *= multiplies and assigns.
- /= divides and assigns.
- %= finds the remainder and assigns.
- Chain these to set one value for many variables.
Comparison Operators
- These return true or false.
- Use > or < to compare size.
- Use == to check equality.
- Strings compare by character codes.
- Convert strings to lowercase for accuracy.
Strict Equality
- Use === for strict checks.
- It avoids type conversion.
- "10" == 10 is true.
- "10" === 10 is false.
Source: https://dev.to/pdhanush26/operators-in-javascript-1nm2