Codington
0 of 8 problems solved • 0%

Exercise prompt

Destructure a Function Parameter

A function parameter can destructure an incoming object. The function body can then use the extracted names directly.

Example

function printUser({ name, age }) { console.log(name, age); } printUser({ name: "Mira", age: 20 }); // Output: // Mira 20

Your task

Refactor getCourseLabel to destructure title and lessons in its parameter, then complete the label as JavaScript: 12 lessons. Do not read course.title or course.lessons in the body.