Skip to content

Glossary: JavaScript in the Browser

Optional chaining and nullish coalescing (?. and ??)

Also written: ?., ??

?. skips a property read or call when the value is null or undefined, and ?? supplies a default only for null or undefined. For example, cart.get(sku) ?? 0 gives 0 for a new SKU.

Where the book teaches it

Related terms

null