This lesson will explain the solution to the problem in the previous lesson.
function display(){ const exampleObject = {collection: [{name: "Kelly",}, {name: "Anna",}],} const { collection: [,{name: secondObject,}] } = exampleObject console.log(secondObject)}display()
This problem has a one-line solution. Let’s start by discussing what exampleObject contains:
exampleObject
const exampleObject = { collection : [ {name: "kelly",}, {name: "Anna",}