In TypeScript, there are two ways of assigning a type to a variable. Type Declaration Type Assertion If you have ever written typescript code, you most probably would have used both of them at some point in time. So let's dive deep into what type d...

Markdown supported · ⌘↵ to post
Type Assertion can be helpful in unit tests, when you need to create some typed object, but you don't need all its properties. Otherwise, I try to avoid it because it is almost like typing things with any.
Hanamant k
UI Engineer
Great post..!! In last paragraph of post you mentioned ' Type assertion gives more safety '. is that typo mistake...??