Curriculum help - java script basics

https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-javascript/profile-lookup

for(var i=0;i<contacts.length;i++)
{
  if(contacts[i].firstname === name)
       {
               if(contacts[i].hasOwnProperty(prop))
                {
                    return contacts[i][prop];
                 }
              else {
                         return "No such property"
                      }
        }

}
return "No such contact";

Hey Sathish,

I think I’ve already shown you how to use the “preformatted text” tool in the editor ( </> ) to add code.

Let us know if you have problems using it.


I think the correct key is not firstname.

thank you man. yeah, I should help to get help. let me use it next time. let me put code neatly next time. thank you. stuck for 2 hours and you helped… god bless…

1 Like