ALL LESSONS Module 4

Operators in JavaScript

Apr 5, 2026 1 min read

JavaScript Operators

Perform operations on variables and values.

Operators Example

let a = 10, b = 3;

console.log(a + b);     // 13
console.log(a > b);     // true
console.log(a % b);     // 1
console.log(a++);       // 10 (post-increment)
console.log("Age: " + a); // String concatenation

// Ternary
let status = age >= 18 ? "Adult" : "Minor";

Key Points

  • Arithmetic: +, -, *, /, %, ** (exponent).
  • Comparison: ==, ===, !=, !==, >, <.
  • Logical: &&, ||, !.
  • Strict equality === checks type too.

Need help with this lesson? Visit the Discussion Forum