# TS2345: Argument of type '…' is not assignable to parameter of type '…'.

> A function is called with an argument whose type doesn't match the parameter. Convert the argument, or fix the parameter's type.

## What it means

Each argument must be assignable to the type of the parameter it fills. When it isn't, the
message names both types; for objects, extra indented lines point to the property that
differs. For overloaded functions the error is TS2769 instead.

## Example

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

export const s = square("4");
```

## How to fix

- Convert the argument: `square(Number("4"))`.
- Narrow a union argument first (for example check for `undefined`).
- If the function should accept more, widen the parameter type.

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