Codington
0 of 8 problems solved • 0%
Use in a course

Exercise prompt

Use a Destructuring Default

A destructured variable can receive a default when its property is missing or undefined. Existing property values are kept.

Example

const settings = { theme: "dark" }; const { language = "en" } = settings;

Your task

Destructure role from account with the default student. Do not add a property to the object. Display Role: student.