Tue. Oct 29th, 2019

Host your Website

Read and learn

Pro tip: type-check your JavaScript the easy way!

1 min read



Sure, TypeScript isn’t for everyone. But sometimes you want types and type-checking… well, turns out you can use the TypeScript compiler to check the types on your JavaScript – let me show you how!

More info: https://www.typescriptlang.org/docs/handbook/type-checking-javascript-files.html

4 thoughts on “Pro tip: type-check your JavaScript the easy way!

  1. JSDoc is actually still the only way to add a description to your functions and variables, even TypeScript ones.
    You can actually use it in place of TypeScript types in .ts files. You can't do all the type manipulations that TypeScript allows of course, but in many cases it's enough.
    I think JSDoc is the unsung hero of all this. Not many really use it correctly, and the official docs are IMO quite lackluster…

Comments are closed.

Copyright © All rights reserved. | Newsphere by AF themes.