๐๐ฎ๐๐ฎ๐ฆ๐ฐ๐ฟ๐ถ๐ฝ๐ ๐ข๐ฝ๐ฒ๐ฟ๐ฎ๐๐ผ๐ฟ๐ ๐๐๐ถ๐ฑ๐ฒ
Operators change values and variables. You use them for math, logic, and comparisons.
Arithmetic Operators
- adds numbers.
- subtracts numbers.
- multiplies numbers.
- / divides numbers.
- % finds the remainder.
- ** handles exponents.
Type Conversion
- "5" + 5 equals "55".
- "5" - 5 equals 0.
- True equals 1.
- False equals 0.
Assignment Operators
- = sets a value.
- += adds and sets a value.
- -= subtracts and sets a value.
Comparison Operators
- == checks the value.
- === checks the value and the type.
- 5 == "5" is true.
- 5 === "5" is false.
- Use === to stop bugs.
Logical Operators
- && returns true if all parts are true.
- || returns true if one part is true.
- ! flips the boolean value.
Increment and Decrement
- a++ adds 1 after use.
- ++a adds 1 before use.
- a-- subtracts 1.
Source: https://www.geeksforgeeks.org/javascript/javascript-operators/ Source: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_operators#arithmetic_operators Optional learning community: https://dev.to/annapoo/how-does-increment-and-decrement-work-in-js-46hi