Skip to content
Justice Tech School

Operators

Arithmetic operators: + - * / % (remainder) ** (power). Comparison operators: === (strictly equal), !== , < , > , <= , >=.

Always prefer === over ==. The double version converts types and gives surprising results. Logic operators are && (and), || (or) and ! (not).

Example
console.log(10 % 3);
console.log(2 ** 5);
console.log(5 === "5");
console.log(5 == "5");
console.log(true && false);
console.log(true || false);

Exercise

Check that a is strictly equal to 5.

console.log(a  5);

Quiz Test

What is 10 % 3?

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