# Profile Lookup - Stucked for two days

**URL:** <https://forum.freecodecamp.org/t/profile-lookup-stucked-for-two-days/444805>\
**Category:** Curriculum Help\
**Tags:** javascript\
**Created:** [February 6, 2021, 8:38pm UTC](https://forum.freecodecamp.org/t/profile-lookup-stucked-for-two-days/444805 "2021-02-06T20:38:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![titokanito88](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/titokanito88/32/140131_2.png) [@titokanito88](https://forum.freecodecamp.org/u/titokanito88)\
**Post date:** [February 6, 2021, 8:38pm UTC](https://forum.freecodecamp.org/t/profile-lookup-stucked-for-two-days/444805/1 "2021-02-06T20:38:22Z")

</div>

Hello Campers,

I´m triying this challenge for almost 1,5 days.

I would like to solve it with out using for Loops (if it is possible).

after read again and again and again functions, how to access object properties and arrays, how to test objects for properties, I still not finding the answer.

My code until now is:

```auto
function lookUpProfile(name, prop){
// Only change code below this line

if (contacts.hasOwnProperty("firstname") && prop["firstname"] === name) {
    return name[prop];
} else if (name !== contacts.hasOwnProperty) {
    return "No such contact";
} else if (prop !== name.hasOwnProperty) {
    return "No such property";
}
// Only change code above this line
}

lookUpProfile("Akira", "likes");

```

Waht I´ve understood is that first of all, I should check thath (name) is a contact´s first name, and I can do this testing objects for properties, right?

Then, if result is true, it should show the result with value “name” (or “prop” I´m not really sure about that, are name and prop arguments or parameters in the function?).

If name is not a contact´s firstname, then returns “Not such contact”, this point is completed with my code.

The other target is to check if (prop) matchs with contact name´s properties (prop is an argument, or is a value, or a propertie?, I´m really confused here). If prop doesn´t match, then “Not such property” must be showed.

I tried to understan why a function has arguments, parameters, properties and values…  
and inside a function could be variables and arrays… has someone a link where I can find more info about?

Thanks for your support.

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [February 6, 2021, 8:41pm UTC](https://forum.freecodecamp.org/t/profile-lookup-stucked-for-two-days/444805/2 "2021-02-06T20:41:35Z")

</div>

> [@titokanito88](#):
>
> `contacts`

is this an object?

do you have the challenge link?

---

<div class="post-metadata">

**Author:** ![JeremyLT](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/jeremylt/32/291894_2.png) [@JeremyLT](https://forum.freecodecamp.org/u/JeremyLT)\
**Post date:** [February 6, 2021, 8:44pm UTC](https://forum.freecodecamp.org/t/profile-lookup-stucked-for-two-days/444805/3 "2021-02-06T20:44:45Z")

</div>

A loop is required somewhere. Either you need to write a loop yourself to find if/which contact has a matching name, or you need to call a method that internally uses a loop.

I don’t think that you understand the structure of your data.

You have an array of contacts.

Each contact has a firstName and some additional properties.

Your goal is to first find if a contact in the array has a firstName that matches.

Then you need to check if that contact has the requested problem.

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [February 6, 2021, 8:46pm UTC](https://forum.freecodecamp.org/t/profile-lookup-stucked-for-two-days/444805/4 "2021-02-06T20:46:01Z")

</div>

> [@titokanito88](#):
>
> I tried to understan why a function has arguments, parameters, properties and values…  
> and inside a function could be variables and arrays… has someone a link where I can find more info about?

a function has arguments and parameters, everything else you have mentioned is data types and data structures and it is what a programming language is made of

you may need to review what each of those is

a function is a reusable piece of code that does stuff parametrically

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/freecodecamp/original/3X/e/1/e1c433102e34b46dfaa3e15d13ab9a514b127078.svg) [@system](https://forum.freecodecamp.org/u/system)\
**Post date:** [August 8, 2021, 8:46am UTC](https://forum.freecodecamp.org/t/profile-lookup-stucked-for-two-days/444805/5 "2021-08-08T08:46:14Z")

</div>

Closed on August 8, 2021, 8:46am UTC

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.
