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

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); }

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.