In TypeScript, when we want to define an object type, there are several concise options such as 'Object', '{}', and 'object'. What are the differences between them?

## Object (uppercased)

Object (uppercased) describes properties common to all JavaScipt objects. It is defined in the [_lib.es5.d.ts_](https://github.com/microsoft/TypeScript/blob/main/src/lib/es5.d.ts#L105) file that comes with the TypeScript library.

![TypeScript Object type definition showing common properties like toString and valueOf methods](https://img.upweb.dev/content/b02448f2-1028x768.png)

As you can see, it includes some common properties like `toString()`, `valueOf()`, and so on.

Because it emphasizes only those properties that are common to JavaScript objects. So you can assign boxable objects like `string`, `boolean`, `number`, `bigint`, `symbol` to it, but not the other way around.

![TypeScript Object type assignment example with boxable types like string, boolean, and number](https://img.upweb.dev/content/3c825ed5-661x484.jpg)

## **{}**

`{}` describes an object that has no members of its own, which means TypeScript will complain if you try to access its property members:

![TypeScript empty object type {} example showing property access restrictions](https://img.upweb.dev/content/1308cead-538x768.jpg)

From the code example above, we can see that `{}` and `Object` (uppercased) have the same features. That is, it can only access those properties that are common (even if the JavaScript code logic is correct), all boxable objects can be assigned to it, etc.

This is because the `{}` type can access those common properties through the prototype chain, and it also has no own properties. So it behaves the same as the `Object` (uppercased) type. But they represent different concepts.

## **object (lowercased)**

object (lowercased) means any non-primitive type, which is expressed in code like this:

```typescript
type PrimitiveType =
  | undefined
  | null
  | string
  | number
  | boolean
  | bigint
  | symbol;

type NonPrimitiveType = object;
```

This means that all primitive types are not assignable to it, and vice versa.

![TypeScript lowercase object type showing primitive type assignment restrictions](https://img.upweb.dev/content/880a27a2-699x610.jpg)

_If you found this helpful, consider [subscribing to my newsletter](https://upweb.dev) for weekly web development insights and updates. Thanks for reading!_
