...

/

Declaring Types in Untyped Code

Declaring Types in Untyped Code

This lesson delves into how to declare types on a JavaScript code that does not have a type.

We'll cover the following...

The keyword declare can be used before one of the previous three declaration types (var, let, const). As the name suggests, it declares to TypeScript that the variable is somewhere but not saying where. This is not used frequently but can be useful if you need to tell the transpiler that the variable is present, ...