0 of 8 problems solved • 0%

Exercise prompt

Copy an Array with Spread

Array spread copies items into a new array.

Example

const original = ["a", "b"]; const copy = [...original];
  • [...original] creates a separate array with the same items, in order.
  • Adding an item to copy leaves original unchanged.

This is a shallow copy: nested arrays or objects would still be shared.

Your task

Copy topics into plannedTopics with spread syntax. Add objects only to the copy, then display both arrays.