Destructuring and Spread

Talk it through with a coach who asks guiding questions and gives hints until you reach the answer. Pass to mark the challenge as completed.

The problem

  • easy
  • Pro

You're reviewing code that reads five fields from an options object one line at a time, and builds a new array by looping over two others and pushing each item. Explain how destructuring and the spread and rest syntax would make this shorter, and what to watch out for.

Talk this problem through with an AI coach

This is a Pro challenge. Sign in with Google, then upgrade to start a voice session.

Start free →