Your naming conventions are too similar and you are mixing different things.

When you call a function like this `setValues(numbers);`

… and the function looks like this: `const setValues = function(arr){ doSomething}`

… inside the function `arr`

equals/ is referencing the array you called the function with (`numbers`

).

So if you want to use the function over and over you name the argument something like `arr`

or `array`

so it’s easy to understand / read and you don’t mix e.g. `numbers`

with `number`

.

Also this `i`

in the for loop is `iteration or index`

(` i = 0;`

) which increments and the `[ ]`

are property accessors.

Every loop `i`

increments 0,1,2 … so `array[i]`

is saying get/ set `array`

index of the value of `i`

.

You can also just say `array[8]`

and get index 8 but that wouldn’t increment…

You also need to call the function and save the results to a variable like `let results = setValues(numbers)`

.

Then results will look like this after `setValues`

runs:

results = {

average: 45065.68421052631,

eights: [712, 456, 472],

evens: [244, 758, 450, 302, 20, 712, 456, 398, 882, 940, 472],

odds: [469, 755, 245, 71, 21, 339, 848179, 535],

smallestNumber: 20,

sum: 856248

}

You can access the values using dot notation: `results.sum`

or bracket notation: `results['sum']`

.

You can also do this:

```
var value = 'sum';
console.log(results[value]) // logs results.sum;
value = 'average';
console.log(results[value]) // logs results.average;
```

Which is also the same as:

let numbers = [2,5,9,4]

let index = 2;

numbers[index] = ‘changed’; // is the same as numbers[2]

console.log(numbers) // [2, 5, ‘changed’, 4]

This is a more compact version that works

```
let numbers = [469,755,244,245,758,450,302,20,712,71,456,21,398,339,882, 848179,535,940,472,
];
const setValues = function (arr){
if(arr[0] == null) return;
let obj = {
evens: [],
odds: [],
eights: [],
sum: 0,
average: 0,
smallestNumber: 0,
}
obj.smallestNumber = arr[0];
for (i = 0; i < arr.length; i++){
obj.sum += arr[i];
if (obj.smallestNumber > arr[i]) obj.smallestNumber = arr[i];
if (arr[i] % 2 == 0) obj.evens.push(arr[i]);
if (arr[i] % 2 !== 0) obj.odds.push(arr[i]);
if (arr[i] % 8 == 0) obj.eights.push(arr[i]);
}
obj.average = obj.sum / arr.length;
return obj;
}
let results = setValues(numbers);
document.write(`Sum: ${results.sum}`)
document.write(`Average: ${results.average}`)
document.write(`Smallest number: ${results.smallestNumber}`)
document.write(`Even numbers: ${results.evens.join(", ")}`)
document.write(`Odd numbers: ${results.odds.join(", ")}`)
document.write(`Numbers divisible by eight: ${results.eights.join(", ")}`)
```

I hope this makes sense, if it doesn’t maybe go back through some videos and articles and go back over arrays, functions and arguments, property accessors, modulo operator and += operator.