# TS2558: Expected … type arguments, but got ….

> A generic function or type gets more or fewer explicit type arguments than it has type parameters. Pass the right number.

## What it means

When you write `f<A, B>(...)` explicitly, the number of type arguments must fit the function's
type parameters (type parameters with defaults may be left out).

## Example

```ts
function first<T>(items: T[]): T | undefined {
  return items[0];
}
export const x = first<string, number>(["a"]);
```

## How to fix

- Pass as many type arguments as the function declares.
- Or leave them out and let them be inferred: `first(["a"])`.

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