Question: I want to return number of truthy values in the array below.

```
const array = [1,2,3,'',2];

function countTruthy (array) {

let numberCount = 0;

for (let item of array) 

    console.log(item)

    if (item) numberCount++;

    return numberCount;

```

But this only works after I remove this line.

```
console.log(item)

```

Otherwise I get: Uncaught ReferenceError: item is not defined
at countTruthy?

Why?

Bonus question - No matter how my return statement is indented I get the same result back... but should it be under the "if statement" or the "for loop"? Why?

Answer: 
I hope this will be useful for you:

When you don't use braces '{}' in the "for", any loop or condition, only the next line is taken for that process. In your case, if you remove the log, the item is recognized by the "for", but if you add the log in the next line, as it does not have the keys "{}" the "for" only operates with the next line and the item no longer belongs to the "for" so it is no longer recognized and you would have to declare it outside the "for"

```js
const array = [1,2,3,'',2];

function countTruthy (array) {

  let numberCount = 0;

    for (let item of array) 
    {
      console.log(item);
      if (item) numberCount++;
    }
    return numberCount;
}

countTruthy(array);
```
It seems to be an indentation issue. Use brackets to close the function and for loop like this:

```
const array = [1,2,3,'',2];

function countTruthy (array) {

  let numberCount = 0;

  for (let item of array) {
    console.log(item)

    if (item) numberCount++;

  }
  return numberCount;
}

```