any type

Opts a value out of type checking, allowing any operation.

Since TS 1.0 Spec ↗

Syntax

any

Examples

let data: any = fetchRaw();
data.whatever().chain(); // no error, no checking
function legacy(x: any) {
  return x + 1; // unchecked
}

Notes

`any` disables type checking for a value and propagates: assigning `any` to a typed variable silently bypasses safety. Prefer `unknown` for untyped inputs. Enable `noImplicitAny` to flag accidental `any`. Use it only as a deliberate, isolated escape hatch.

See also