title: Why is prop showing not defined?
body: <p>So I have this code which Im running on Freecodecamp. Can't understand why its showing prop is not defined.</p>
  
  <p>prop is actually taking values from the function when its called. Unlike prop, name isn't coming as not defined. </p>
  
  <pre><code>var contacts = [
  {
      "firstName": "Akira",
      "lastName": "Laine",
      "number": "0543236543",
      "likes": ["Pizza", "Coding", "Brownie Points"]
  },
  {
      "firstName": "Harry",
      "lastName": "Potter",
      "number": "0994372684",
      "likes": ["Hogwarts", "Magic", "Hagrid"]
  },
  {
      "firstName": "Sherlock",
      "lastName": "Holmes",
      "number": "0487345643",
      "likes": ["Intriguing Cases", "Violin"]
  },
  {
      "firstName": "Kristian",
      "lastName": "Vos",
      "number": "unknown",
      "likes": ["JavaScript", "Gaming", "Foxes"]
  }
  ];
  
  
  function lookUpProfile( name, prop){
  // Only change code below this line
  
  switch(name) {
    case "Akira":
    case "Harry":
    case "Sherlock":
    case "Kristian":
    for ( var j=0; j&lt;contacts.length;j++) {
    if(contacts[j].firstName == name) {
      return contacts[j][prop];
    } else {
       console.log("No such contact");
    }
  }break;
  }
  }
  
  if (!contacts.hasOwnProperty(prop)) {
    console.log("No such property");
  // Only change code above this line
  }
  
  // Change these values to test your function
  lookUpProfile("Kristian", "lastName");`
  </code></pre>