Hi Everyone,
Completely lost and confused. I can’t figure out how to match the source property to the collection. I feel like my brain is completely stuck. please help
Thanks!
Your code so far
function whatIsInAName(collection, source) {
// What's in a name?
var arr = [];
// Only change code below this line
// Only change code above this line
function matchingWord(value){
return value == source;
}
var match = collection.filter(matchingWord);
return match;
}
whatIsInAName([{ first: "Romeo", last: "Montague" }, { first: "Mercutio", last: null }, { first: "Tybalt", last: "Capulet" }], { last: "Capulet" });
Your browser information:
Your Browser User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36
.
Link to the challenge:
https://www.freecodecamp.org/challenges/wherefore-art-thou