Tell us what’s happening:
Describe your issue in detail here.
**Your code so far**
function whatIsInAName(collection, source) {
var arr = [];
// Only change code below this line
let sourceKeys=Object.keys(source)
//console.log(sourceKeys)
arr=collection.filter(item =>
{
for(let prop of sourceKeys)
{
if(source[prop]!==item[prop])
{
return false;
}
}
return true;
})
console.log(arr)
// Only change code above this line
return arr;
}
whatIsInAName([{ "apple": 1, "bat": 2 }, { "bat": 2 }, { "apple": 1, "bat": 2, "cookie": 2 }], { "apple": 1, "bat": 2 });
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36
Challenge: Wherefore art thou
Link to the challenge: