operators that operate on numbers. 🚧 under construction -> unary ops
JS ⟩ statement ⟩ expression ⟩ operator ⟩ arithmetic ⟩
(operator) that operate on numbers.
unary:+, -, ++, --
binary: +, -, *, /, %, **
+
-
*
/
%
**
bitwise: ~, ^, |, >>, <<, >>>
~
🌟 table of operators
arithmetic operators do not allow to mix BigInt and Number❗
in an arithmetic operation:
non-numeric operands that cannot convert to numbers convert to NaN.
if either operand is (or converts to) NaN, the result is (almost always) NaN.
unary arithmetic operators
bitwise operators
binary arithmetic operators
➕ add/concate (+)
➕ exponentiation (**)
➕ division (/)
➕ remainder (%)
💾 modulo(a, b) - modulo
💾 mod(a, b)
⚖️ remainder vs. modulo vs. mod
⚠️non-numeric operand
JavaScript: The Definitive Guide ⟩ 4.8
Last updated 3 years ago