Tell us what’s happening:
I was at this point and was getting the right results back (I think) but missing the quotes in the array. I can’t figure it out.
Your code so far
function whatIsInAName(collection, source) {
var arr = [];
let newCol = collection.find(function(value) {
return value.last === source.last;
})
arr.push(newCol);
// 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 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/wherefore-art-thou/