# `OmitThisParameter<Type>`

> The `OmitThisParameter<Type>` utility type in TypeScript removes the `this` parameter from a function type.

## What does OmitThisParameter do in TypeScript?

The utility type that constructs a function type without the `this` parameter. Useful for describing functions after they are bound with `bind()`.

- Topic: Utility Types
- Type: utility type

## Example

Wrong:

```ts
function toHex(this: number) {
  return this.toString(16);
}
const fiveToHex = toHex as unknown as () => string;
```

Right:

```ts
function toHex(this: number) {
  return this.toString(16);
}
const fiveToHex: OmitThisParameter<typeof toHex> = toHex.bind(5);
```

The cast hides the missing `this`; `bind()` supplies it, and `OmitThisParameter` types the bound result.

## Common mistakes

- Casting an unbound method to a plain function type and getting `this` as undefined at runtime.

## Key points

- It is used for functions that are already bound, e.g. the result of `fn.bind(obj)`.
- Unbound methods are not typed with it, since calling them without `this` still fails at runtime.

## Interview questions

### What does bind() return in TypeScript?

With `strictBindCallApply`, `fn.bind(obj)` returns `OmitThisParameter<typeof fn>`, so the bound function no longer needs `this`.

### What if the function has no this parameter?

`OmitThisParameter<T>` returns the function type unchanged.

## Related cards

- [`ThisParameterType<Type>`](https://wonderium.dev/ts/thisparametertype.md)
- [`ThisType<Type>`](https://wonderium.dev/ts/thistype.md)
- [.bind()](https://wonderium.dev/js/bind.md)
- [this](https://wonderium.dev/js/this.md)
- [Function Types](https://wonderium.dev/ts/function.md)

---

- Level: [TypeScript](https://wonderium.dev/ts.md)
- HTML version: https://wonderium.dev/ts/omitthisparameter
- Last updated: 2026-11-25
