Building Your Learning Module...
Getting things ready for you!
Find videos you like?
Save to resource drawer for future reference!
Operators are special symbols that tell JavaScript to perform actions with your data. Think of them as the verbs in your code - add, compare, combine!
5 + 3 - The + is an operator that adds two numbers together to get 8!Math operations: +, -, *, /
Compare: ===, >, <, >=
Combine: &&, ||, !
Assign: =, +=, -=
5 + 3 = 810 - 4 = 66 * 7 = 4220 / 4 = 510 % 3 = 12 ** 3 = 8Performing calculations with numbers
5 === 5 → true5 !== 3 → true10 > 5 → true3 < 8 → true5 >= 5 → true4 <= 7 → true=== (strict equality) instead of ==. It checks both value AND type!Comparing values returns boolean results
true && true → true ✅true && false → false ❌false && false → false ❌true || true → true ✅true || false → true ✅false || false → false ❌!true → false!false → trueCombining conditions for decision making
x = 5x += 3 → x = x + 3x -= 2 → x = x - 2x *= 4 → x = x * 4x++ → x = x + 1x-- → x = x - 1Shortcuts for updating variables
The + operator can also join strings together!
const firstName = 'John';
const lastName = 'Doe';
// Combine strings
const fullName = firstName + ' ' + lastName;
console.log(fullName); // John Doe
// With numbers becomes a string
const result = '5' + 3;
console.log(result); // '53' (string!)
// But other operators convert to number
console.log('10' - 5); // 5 (number)
console.log('10' * 2); // 20 (number)=== not ==&& means both must be true|| means at least one true! flips true ↔ false+= is shorthand for x = x +