Skip to content
Justice Tech School

TypeScript Operators

Arithmetic, comparison and logical operators work as in JavaScript. Use === for strict equality, ** for powers, ?? for defaults and ?. for safe access.

Example
console.log(17 % 5, 2 ** 10, 7 / 2);
console.log(5 === 5, "5" === 5, 5 !== 6);
console.log(0 || "fallback", 0 ?? "kept");

Result

2 1024 3.5
true false true
fallback 0

Exercise

Strict equality.

a  b

Quiz Test

Which compares value and type?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.