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

Exercise prompt

Collect the Rest of an Object

Rest syntax in destructuring collects properties that were not extracted into a new object. It also uses ..., but it gathers values instead of spreading them out.

Example

const user = { name: "Mira", age: 20, city: "Lund" }; const { name, ...details } = user;

Your task

Predict which keys remain after extracting title. Replace the placeholders and empty prediction, then destructure book so details contains author and pages. Keep the actual output line.

Hint

The rest object contains what was not named explicitly.