i think u have error in if else statement. the task is :
The function should check if name is an actual contact’s firstName and the given property ( prop ) is a property of that contact.
If both are true, then return the “value” of that property.
If name does not correspond to any contacts then return the string No such contact .
If prop does not correspond to any valid properties of a contact found to match name then return the string No such property .
there has “given property (prop) is a property of that contact” text. so the if else statement need to check are the contacts have same property in given props? how do u check it? use hasOwnProperty(). if u using contacts[i].likes === prop it just checking are in contacts[i].likes has “likes” value?
and just my suggest. use else to return “No such property” instead || operator in return. maybe