Skip to content

Glossary: JavaScript Basics

Nullish coalescing

Also written: ??

The `??` operator, which gives a default: `a ?? b` is `a` unless `a` is `null` or `undefined`. Unlike `||`, it keeps a real 0.

Where the book teaches it

Related terms

FalsyOptional chaining