---
id: 699f4b903bf5427a599f791d
title: Step 14
challengeType: 1
dashedName: step-14
---

# --description--

In the last few steps, you will build out one more function to continue practicing type annotations with functions. 

Start by creating a function called `raiseTo` which take two parameters called `base` and `exponent`. Both parameters should be of type `number`. The function should return the result of raising the `base` to the power of the `exponent`. The return type of the function should also be annotated as `number`.

# --hints--

You should have a `raiseTo` function.

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

Your `raiseTo` function should have two parameters, `base` and `exponent`.

```js
assert.match(
  code,
   /function\s+raiseTo\s*\(\s*base\s*(?::\s*number)?\s*,\s*exponent\s*(?::\s*number)?\s*\)\s*|(?:const|let)\s+raiseTo\s*=\s*\(\s*base\s*(?::\s*number)?\s*,\s*exponent\s*(?::\s*number)?\s*\)\s*=>/
);
```

Your `base` and `exponent` parameters should both be of type `number`.

```js
const explorer = await __helpers.Explorer(code);
const { parameters } = explorer.allFunctions.raiseTo;
assert.isTrue(parameters[0].matches("base: number"));
assert.isTrue(parameters[1].matches("exponent: number"));
```

Your `raiseTo` function should return a number.

```js
assert.isNumber(raiseTo(2, 3));
```

Your `raiseTo` function should return the result of raising the `base` to the power of the `exponent`.

```js
assert.strictEqual(raiseTo(2, 3), 8);
```

Your `raiseTo` function should have a return type annotation of `number`.

```js
const explorer = await __helpers.Explorer(code);
const { raiseTo } = explorer.allFunctions;
assert.isTrue(raiseTo.hasReturnAnnotation("number"));
```

# --seed--

## --seed-contents--

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

const result = square(5);

console.log(result);

function getAverage(numbers: number[]): number {
  const sum = numbers.reduce((acc, n) => acc + n, 0);
  return sum / numbers.length;
}

const avgResult = getAverage([2, 14, 26, 8]);

console.log(avgResult);

--fcc-editable-region--

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

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