Work with DOM Elements in TypeScript using Type Assertions

John Lindquist
InstructorJohn Lindquist

Share this video with your friends

Send Tweet

The DOM can be a bit tricky when it comes to typing. You never really know exactly what you're going to get, so you have to educate your codebase into what you know you're using. This is done using Type Assertion where TypeScript types know they're a certain type, but you give it additional information so you can access the properties and methods that you know will be available.

Navneet Kumar Sharma
Navneet Kumar Sharma
~ a year ago

How to autocomplete jsdoc options?

Lauro Silva
Lauro Silva
~ a year ago

Hey Navneet - The way you choose will depend on your project requirements, as well as in your preferences and needs. A good starting point is checking out this resource. Hope that helps!