# TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.

> The left side of `instanceof` is a primitive type, which is never an instance. Use `typeof` for primitives.

## What it means

`x instanceof C` checks an object's prototype chain. When `x` is typed as a primitive such as
`string` or `number`, the test can't succeed.

## Example

```ts
const value = "text";

export const isString = value instanceof String;
```

## How to fix

- Use `typeof value === "string"` for primitives.

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