Skip to main content
Brave Programmer Logo

BraveProgrammer

BraveProgrammer

HomeProjectsBlogsCoursesLessonsAbout

Site footer

BraveProgrammer

Free coding courses, practical tutorials, and real projects from BraveProgrammer. Learn web development with React, Next.js, and TypeScript.

Navigation

  • Home
  • Projects
  • Blogs
  • Courses

Resources

  • About
  • Lessons

© 2026 BraveProgrammer. All rights reserved.

  1. Courses
  2. /
  3. JavaScript Course

Lesson 4 of 55 · javascript

Operators & Expressions

Duration: 9 mins

Arithmetic, comparison, logical, bitwise, assignment, and ternary operators.

OperatorExampleMeaning
+ - * / %5 * 2arithmetic
=== !==a === bstrict equality
&& ||a && blogical AND / OR
?:cond ? a : bternary (inline if)
??a ?? bnullish coalescing
?.obj?.propoptional chaining

Example: Nullish coalescing vs logical OR

let foo = 0;
console.log(foo || 42);   // 42 (because 0 is falsy)
console.log(foo ?? 42); // 0  (nullish coalescing only for null/undefined)
Previous: Data Types & Type‑CoercionNext: Control Flow – if / switch / loops