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;
}

```
In order for this to work as expected, you should pass an object into `find_values()`, rather than an array as you are doing. Also, you will want to update the flow of your function, by returning false after loop iteration has completed:

```js
function find_value(key){
    for (var i of Object.values(key)){
        // Only early return if matching value found
        if (i == 7){
            return true;
        }
    }

    // Move return false outside of loop
    return false;

}

var object_input  = {'effort': 4, 'doctrine': 8, 'item': 11, 'behavioral': 7, 'occasional': 11};

console.log( find_value(object_input) );  
```