Sitemap
Totally TypeScript

Can’t get enough TypeScript? Not sure what those <> angle brackets are for? We’ve got you covered.

Follow publication

Member-only story

What Is the Empty Object {} Type in TypeScript?

4 min readApr 30, 2025

--

You’re going to need `Record<Keys, Type>` instead of `{}`, but what are Keys and Type for an empty object? Photography credit: Mushaboom Studio for Unsplash+. (Unsplash+ license, used with permission.)
type EmptyObjWrong = {}
let objWrong: EmptyObjWrong = { name: "Derek" }
objWrong = "Intentionally allowed by TypeScript."
// No error from the TypeScript compiler in either case! 🤯

ESLint Will Remind You…

--

--

Totally TypeScript
Totally TypeScript

Published in Totally TypeScript

Can’t get enough TypeScript? Not sure what those <> angle brackets are for? We’ve got you covered.

Dr. Derek Austin 🥳
Dr. Derek Austin 🥳

Written by Dr. Derek Austin 🥳

Hi, I'm Doctor Derek! I've been a professional web developer since 2005, and I love writing about programming with JavaScript, TypeScript, React, Next.js & Git.

Responses (3)