Need some help , profile look up

Need some help , profile look up
0.0 0

#1


could not understand the whole code system

function lookUpProfile(firstName, prop){
// Only change code below this line
  var answer = "No such contact";
  contacts.some(function (arg) {
    if (arg.firstName === firstName && arg.hasOwnProperty(prop) === true) {
      answer = arg[prop];
    } else if (arg.hasOwnProperty(prop) === false) {
      answer = "No such property";
    }
  });
  return answer;

#2

I’m not sure where you got the idea to use .some(), but I don’t think you fully understand it. Here is the documentation. In this case you’re probably better off just using a simple loop.