Operators
In programming there are 4 fundamental operations with data.
Assignment: storing a data value in a variable
Arithmetic: operators used for mathematical calculations
Comparison: operators used to compare two values
Logical: operators used to combine multiple Boolean values or assess the True or False aspects between multiple values
Assignment Operation
let name = "Mr. Park";
Assignment operation is a way to store a value into a labeled container called a variable.
Arithmetic Operation
+
Addition
-
Subtraction
*
Multiplication
**
Exponentiation
/
Division
%
Modulus (Division Remainder)
++
Increment
--
Decrement
Arithmetic operations all require two values (a left operand and a right operand) except for the increment and decrement operators.
// Arithmetic Examples:
let x = 10;
let y = 5;
console.log(x + y);
console.log(x - y);
console.log(x * y);
console.log(x / y);
console.log(x ** y);
console.log(x % y);
console.log(x++);
console.log(y--);
Comparison & Logical Operator
Comparison and Logical operators will be explained in a future lesson when we learn how to do decision making with programming.
Related Readings
Operators (Link)
Last updated