DEV Community

Discussion on: How to use in Typescript: type or interface?

Collapse
 
sinh117801 profile image
Sinh

Thanks for sharing. For me personally, I prefer using Type for object or function params, and interface for class with property or methods

Collapse
 
luizcalaca profile image
Luiz Calaça

Hello, Sinh. Thanks for your contribution, excellent point!

Collapse
 
sinh117801 profile image
Sinh

For me this way is much cleaner and more readable.

Thread Thread
 
luizcalaca profile image
Luiz Calaça

I also agree.