Hello Campers,
This is my first post on this forum I hope you’ll help me.
I got stuck and can’t go further
The code is below.
Kuba
function whatIsInAName(collection, source) {
var arr = collection.filter(function (source){
for (var i = 0; i < collection.length; i++){
if ( collection[i].hasOwnProperty(source) ){
console.log(collection[i]);
}
}
});
return arr;
};
whatIsInAName(
[ { first: "Romeo", last: "Montague" }, //0
{ first: "Mercutio", last: null }, //1
{ first: "Tybalt", last: "Capulet" }], //2
{ last: "Capulet" });