S
S
Shakir Darion2019-10-24 23:20:03
typescript
Shakir Darion, 2019-10-24 23:20:03

Is it possible to assign a type to an empty object in typescript?

const x:{} = {};
As far as I know in typscript it is not possible to declare a type as an empty object, what happens if you do so. x:{}In 2017 I got an error. I don't remember which typescript version I had. But now everything works. What is the reason? I have version^ 3.6.4

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Stanislav Makarov, 2019-10-25
@Nipheris

https://mariusschulz.com/blog/the-object-type-in-t...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question