Javascript Basic Operators And What's The Deal With The Unary Ones?
9 min readOct 4, 2021
Operators are one of the most important building blocks for creating software which is why it is a great idea to learn more about their behavior.
Here’s a brief description of what operators are:
An operator is a mathematical symbol which produces a result from one or two values. These operands are divided between binary and unary operators.
Sounds boring but it just means the following.
TLDR;
// Binary operators
a = 2; // Assignment Operator
a = 2 + 1; // Arithmetic Operator
2 < 3; // Relational Operators
true && false; // Binary Logical Operator// Unary operators
!true // Logical NOT operator
a++ // Postfix Increment Operator
--b // Prefix Decrement Operator
~a // Bitwise NOT operator
Operators fall under the following categories: