0

what is the difference between:

function foo(x: {}) {}

and

function foo(x: object) {}` in TypeScript?

I can't find a case where the two are different. For example, even though null is an Object (with a capital 'O'), neither line of the following type-checks:

const x: {} = null`;
const y: object = null`; 
Max Heiber
  • 14,346
  • 12
  • 59
  • 97

0 Answers0