operators that operate on numbers. 🚧 under construction -> unary ops
Last updated 2 years ago
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