# TS2355: A function whose declared type is neither 'undefined', 'void', nor 'any' must return a value.

> A function declares a return type but has no `return` with a value. Return a value, or change the return type to `void`.

## What it means

A function with a declared return type other than `void`, `undefined`, `any` or `unknown`
must return a value. A body with no `return` statement at all is reported at the return
type.

## Example

```ts
export function total(prices: number[]): number {
  prices.forEach(p => p);
}
```

## How to fix

- Return a value of the declared type.
- If the function returns nothing, declare it as `void`.

Source: https://ts-r.dev/errors/TS2355/
