JS Destructuring
Destructuring extracts fields or list items into bindings. Defaults handle missing or undefined values.
Where to run this
This example uses the JavaScript console playground. Select Run to execute it; the example does not run on this lesson page.
A practical example
const session = {title: "Repair club", places: 12};
const {title, places = 0} = session;
console.log(title, places);
What happens
The two fields become local bindings.