+ 3
It's a linear search Algorithm. It's simple. Just pass over every single position of contacts array searching for a record that matches desired firstName and also has a desired property. It's very similar to a phonebook. When a record matches search criteria(firstName, property), desired property value is returned. If no record matches firstName, then your return will be a string containing. "No such contact". Then if record matches firstName search criteria, but desired property key is not present at the record, your return will be: "No such Property". For example: This will be the outputs:
lookUpProfile("Akira", "likes"); // ["Pizza", "Coding", "Brownie Points"] (Matches firstName, property)
lookUpProfile("Akira", "hobbies"); // No such Property (Matches firstName)
lookUpProfile("Tommy", "likes");/ No such Property (No matching firstName)
Hope this helps you. Enjoy coding!!! :D
+ 2
I'm so glad it helped you. đ