Javascript curriculum intermediate script

type or paste code here
function whatIsInAName(collection, source) {
  var arr = [];
  // Only change code below this line
   var keyarr=[];
   var collectionarr=[];
   for(let i=0;i<collection.length;i++){
   console.log(source[keyarr[0]]);//verifying whether this type of assumption works
   console.log(collection[2][collectionarr[0][0]]);//verifying whether this type of assumption works
   for(let i=0;i<collection.length;i++){ //looping to iterate through each and every object from the collection
          for(let j=0;j<collectionarr[i].length;j++){//looping to iterate through properties of each object of the collection
                       for(let k=0;k<keyarr.length;k++){//looping to iterate through all second argument properties
                              if(source[keyarr[k]]===collection[i][collectionarr[j][k]]){//comparing second argument value with the collection's value
                                     k=keyarr.length;  //in order to go out of the loop, as the object is added already and we don't want to add this object in our array if the condition satisfies for any other property...
                                    j=collectionarr[i].length;//we need to go the collection [i], so increamenting things for that
  // Only change code above this line
  return arr;

whatIsInAName([{ first: "Romeo", last: "Montague" }, { first: "Mercutio", last: null }, { first: "Tybalt", last: "Capulet" }], { last: "Capulet" });

Why doesn’t my code works… it is not passing my if condition… why am I unable to compare? please help. ( I started from C, so you can see C type of solving Javascript)