Question: Write a function named "find\_value" that takes a key-value store as a parameter with strings as keys and integers as values. The function returns a boolean representing true if the value 7 is in the input as a value, false otherwise. (My code below)

```
function find_value(key){
    for (var i of Object.values(key)){
        if (i == 7){
            return true;
        }
        else{
            return false;
        }
    }
}

```

When I call with the input `[{'effort': 4, 'doctrine': 8, 'item': 11, 'behavioral': 7, 'occasional': 11}]`, I should get `true`, but I am getting `false` instead. What am I doing wrong?

Answer: 
Your loops is returning false on your first item, most likely.
You should keep the condition and return true statement in the loop, but after the loop you should return false.

P.S. You should name your parameter and set a default value for good practice. I renamed it in my example below.

```
function find_value(myObject = {}){
    for (var i of Object.values(myObject)){
        if (i == 7){
            return true;
        }
    }
    return false;
}

```
Your function automatically returns true or false in the first iteration. The simplest solution that is very beginner-friendly is to set a boolean flag before the loop and check it at the end of the loop

Also you were looping through the array and checking for a value when the loop would return you an object with property + value pairs. You want to get the values of those objects and check if it is equal to 7

```js
function find_value(key){
    let flag = false;
    for (let i of key){
        console.log(Object.values(i));
        if (Object.values(i).indexOf(7) > -1) {
            flag = true;
        }
    }
    return flag;
}

console.log(find_value([{'effort': 4, 'doctrine': 8, 'item': 11, 'behavioral': 7, 'occasional': 11}]))
```