JavaScript 2025 · Objects and data
Destructure an object
Pull properties into variables, with a default for a missing one.
const { name, email = "none" } = user;
Official JavaScript 2025 documentation
JavaScript 2025 · Objects and data
Pull properties into variables, with a default for a missing one.
const { name, email = "none" } = user;
Official JavaScript 2025 documentation
Was this page helpful?