I’m stuck. I spent a while, with help from a friend and Mozilla Developer Network and got this function I wrote to pass three out of six tests. I’m passing tests where the “source” argument is an object with a single key value pair. But when the “source” argument in the function has two or three key value pairs, I get an empty array as my result. I think the problem is in the first part of my if statement, but I’m just completely out of ideas on how to fix it. I’ve looked at the FCC solutions, but they are really different from mine, so they weren’t super helpful for me fixing my code, which is what I’d rather do instead of copying the solution and just passing the challenge that way. Can you help me fix this?
I tried to include a screenshot of my code (above), and I put in one of the tests I’m not passing and showed how the console returns only an empty array. But also I’m new to these forums, so in case I messed up on including that screenshot, here is my code written out:
function whatIsInAName(collection, source) {
let sourceKeys = Object.keys(source);
let sourceValues = Object.values(source);
let result = [];
for (let i in collection) {
if (collection[i].hasOwnProperty(sourceKeys) && collection[i][sourceKeys] === source[sourceKeys]) {
result.push(collection[i]);
}
}
return result;
}

cheers!!