DEV Community

Discussion on: Why You Should Use Typescript Over Javascript?

 
patarapolw profile image
Pacharapol Withayasakpunt • Edited

As far as I know, you can

  • Use /** @type {} */ to specify types for a variable
  • Use /** @type {} */ (x) to force a variable to type
  • Use /** @typedef {} */ to declare a type in advance

But still,

  • I don't know how to declare generics.
  • I don't know how to export types of JSDoc from a file.

BTW, much of typing works inside /** @type {} */'s bracelets. You can even use import().Class and use TypeScript interface syntax inside them.