Thuta Learning
BasicProgrammingbeginner

JS Operators

Relax. We'll talk through this in plain words — no textbook voice.

JS operators are used to perform calculations on values.

Arithmetic: +, -, *, /, % (modulus)

Assignment: =, +=

Comparison: == (equal value), === (equal value and type), !=, !==, >, <

Logical: && (and), || (or), ! (not)

=== (Strict Equality) is best to use, since it helps you avoid bugs caused by type coercion.

javascript
let x = 5 + 5;
let y = "5" + 5; // "55" (concatenation)
let z = 5 == "5"; // true (loose equality)
let a = 5 === "5"; // false (strict equality)

console.log(z);
console.log(a);
You should see
true false
JS Operators | Thuta Learning