Objects and Destructuring
Objects group related data together. Destructuring and the spread operator make working with them much less repetitive.
JavaScript
What's happening
const { title, lessons } = coursepulls properties straight out of an object into variables....restcollects whatever is left over into a new array (or object).{ ...course, lessons: 7 }copies every property fromcourseinto a brand-new object, then overrideslessons, the original object is never mutated.