---
id: 699f434e294a9e11cf4f65f0
title: Step 8
challengeType: 1
dashedName: step-8
---

# --description--

Now it is time to add another math helper to your toolkit project.

Start by creating a function called `getAverage` which takes one parameter. Your function should return the average for an array of numbers. 

In the next few steps, you will add the type annotations for this function.

# --hints--

You should have a function called `getAverage`.

```js
assert.isFunction(getAverage);
```

Your function should take one parameter.

```js
assert.strictEqual(getAverage.length, 1);
```

Your function should return a number.

```js
assert.isNumber(getAverage([1, 2, 3]));
```

Your function should return the correct result for any array of numbers.

```js
assert.strictEqual(getAverage([1, 2, 3, 4, 5]), 3);
assert.strictEqual(getAverage([10, 20, 30]), 20);
assert.strictEqual(getAverage([5, 10, 15, 20]), 12.5);
```

# --seed--

## --seed-contents--

```ts
function square(num: number) {
  return num * num;
}

const result = square(5);

console.log(result);

--fcc-editable-region--

--fcc-editable-region--
```

```json
{
  "compilerOptions": {
    "noCheck": true
  }
}
```
