0 of 3 saved

JavaScript5 min read

Operators

Read this chapter, write the program on this page, then pass a short check to open the next one.

Arithmetic, comparison, logical, and more.

Operators

Operators combine values: math, comparisons, and logical and/or/not. Template literals and optional chaining show up later.

  • + adds numbers or concatenates strings.
  • && and || short-circuit.
  • ?? (nullish coalescing) only falls back for null/undefined.
const n = 10;
console.log(n + 5, n > 3, n ?? 0);

After you read this chapter, use Write (when available) and Quiz on this page to lock it in.