paint-brush
How to Force JavaScript Variables to use Specific DOM APIsby@fhacker
455 reads
455 reads

How to Force JavaScript Variables to use Specific DOM APIs

by AYO2mNovember 19th, 2019
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

To take advantage of JavaScript IntelliSense and code completion when using a certain awesome text editor *ehem* VS Code, you need to be able to declare the correct interfaces for variables containing DOM elements. For example, if you want to make a variable use a specific DOM interface like the generic type HTMLElement, just do: Before assigning it to a specific type: "Before you assign it," "before you do it" Then, you get code completion for all the methods and other awesomeness that TypeScript doesn’t.
featured image - How to Force JavaScript Variables to use Specific DOM APIs
AYO HackerNoon profile picture
AYO

AYO

@fhacker

Ayo Ayco is a software engineer focused on the Web

About @fhacker
LEARN MORE ABOUT @FHACKER'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

AYO HackerNoon profile picture
AYO@fhacker
Ayo Ayco is a software engineer focused on the Web

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite
Also published here