Briefle
LearnGlossaryPricing

Briefle words · Code & architecture

Optional chaining

Also called ?.

A JavaScript operator that reads a property only if the thing before it exists, and otherwise gives back undefined instead of crashing.

Say it to an AI

React TSX ShippingCard for the order page. customer, shippingAddress and delivery are all optional, so handle them explicitly with optional chaining and nullish coalescing and show readable fallbacks like "Guest checkout" and "date TBC" rather than crashing.

How an expert would brief the stronger version of “Order shipping card”.

See it

Try it as a puzzle →

Card on an online shop's admin order page. Guest orders have no customer; digital-only orders have no address or delivery.

Study A · the stronger one
Study B · the weaker one

Why: A writes order.delivery?.estimatedDate and order.customer?.name. B writes order.delivery.estimatedDate, which throws when delivery is missing.

Related words

  • Edge case
  • Guard clause
  • Swallowed exception
  • Fail fast
  • Side effect
  • Log level
  • Custom error class
  • instanceof check

Room 4 · Errors & edge cases

Learn “Optional chaining” in a five-minute lesson

Start free
AI can build almost anything. The bottleneck is saying what you want.
WordsPricingTermsPrivacyRefundsContact
© 2026 Briefle