TypeScript Types
{} — empty object type
Under strict null checking, {} accepts non-nullish values, including primitive strings and numbers. It does not mean an object with exactly zero keys, and it does not give access to arbitrary properties. To require non-primitives, use object; to require named members, describe their shape. A dictionary type expresses a different contract. Example output: "string". The example was designed for strict checking with an ES2022 target; type annotations do not add runtime validation.
Formal Syntax & Structure
typescript syntaxtypescript
let value: {};Working Example
Example Snippettypescript
const value: {} = "ready";console.log(typeof value);