Profile Lookup Challenge JS

function lookUpProfile(firstName, prop){
// Only change code below this line
var myArr=[];
for(var i=0;i<=contacts.length-1;i++){
  var a=myArr.indexOf(firstName);
    console.log("No such property");
}else {
  console.log("No such contact");
// Only change code above this line


// Change these values to test your function
lookUpProfile("Akira", "likes");

My code works perfectly with Chrome console. I’ve tried every scenario and it works but challenge doesn’t execute my code. The console section is blank. Now i cant pass the challenge. Can anybody help?

You are not returning anything.

It appears to be working, because you are using console.log statements to display the results, but you should be using return statements. The FCC tests are calling the lookUpProfile function and expect results to be returned.

1 Like

i changed and passed it.thanks