Skip to content

Glossary: Coding Interviews in JavaScript

Nullish coalescing (??)

Also written: ??

The `??` operator picks its right side only when the left is missing (`undefined` or `null`). `counts.get(x) ?? 0` starts a count at 0 the first time.

Where the book teaches it

Related terms

Hash map lookup and counting