JavaScript 2025 · Objects and data
Read nested properties safely
Return undefined instead of throwing when something in the chain is null or undefined.
const city = user?.address?.city;
Official JavaScript 2025 documentation
JavaScript 2025 · Objects and data
Return undefined instead of throwing when something in the chain is null or undefined.
const city = user?.address?.city;
Official JavaScript 2025 documentation
Was this page helpful?