I dont understand why my code is not working can someone please explain to me what am doing wrong
function whatIsInAName(collection, source) {
const arr = [];
// Only change code below this line
let ques = Object.values(source);
let array = [];
for (let i of collection) {
array.push(Object.entries(i));
if (array.hasOwnProperty(ques)) {
arr.push(array);
}
}
// Only change code above this line
return arr;
}
whatIsInAName([{ first: "Romeo", last: "Montague" }, { first: "Mercutio", last: null }, { first: "Tybalt", last: "Capulet" }], { last: "Capulet" });
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36
Challenge: Wherefore art thou
Link to the challenge: