JavaScript
Exercise 11 / 15
Destructuring and Spread
Hard
25 points
Use destructuring to extract "name" and "age" from the person object, then use the spread operator to copy the fruits array into a new array.
Destructuring extracts values from objects or arrays. const {name, age} = person extracts properties. The spread operator (...) copies or merges arrays/objects. const new = [...old] copies an array. This is modern ES6 syntax widely used.
Well done! 🎉
Your answer is correct! You earned 25 points.
Not quite...
Try again! You can do it.
Your code
JavaScript
Result