
TypeScript compile-time checking in JavaScript files
Some developers still prefer using plain JavaScript to develop their code instead of TypeScript. But it would be nice if we could use some of the type and error checking features in JavaScript as well!
The good news is that TypeScript has a special functionality that allows us to have this compile-time error and type checking! To use it, we need to have TypeScript installed globally on our computer. In the first line of the JavaScript files, we want to use type and error checking, so we simply need to add // @ts-check, as demonstrated in the following screenshot:

The type checking is enabled when we add JSDoc (JavaScript documentation) to our code. Then, if we try to pass a string to our circle (or circleArea) method, we will get a compilation error:
