Object filter, get item as request from second parameter

Tell us what’s happening:
I’m really confused about this challenge, last 3 I can do it all. But this one I didn’t understand. Please give me some hint or link so I can understand and pass this one.
Thank you.

Your code so far


function whatIsInAName(collection, source) {
var arr = [];
// Only change code below this line


// 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 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36.

Challenge: Wherefore art thou

Link to the challenge:

This one is the second argument, which you’ve to find in the array of objects(first argument)…

  • Initialize the output array (out=[])
  • Transverse through each object in first argument using maybe for loop(let’s call object in each iteration as obj)
  • in the for loop iterate through the properties(let’s say prop) in second argument and check if
    obj[prop] === souce(prop)
    If true add it to the output array else continue to the loop

I hope you got the basic steps