Daily Software Tips & Tricks

Bite-sized knowledge to improve your coding skills daily.

Ditch the Null Checks with Optional Chaining

February 8, 2026

Are you still writing verbose checks like `if (user && user.profile && user.profile.address)` just to safely access deeply nested data? Stop the madness! Modern JavaScript introduced the Optional Chaining operator (`?.`). Now you can safely access properties like this: `user?.profile?.address?.street`. If *any* part of that chain is null or undefined, the expression gracefully short-circuits and returns `undefined`, saving you tons of boilerplate code and potential runtime errors. It drastically cleans up API response handling.