loading...

re: Cool stuff with Typescript VIEW POST

FULL DISCUSSION
 

Using comments with Types

And then you suddenly realize that you can can put TypeScript types in JSDoc as well, that is *.js. (and interfaces are possible with @typedef)

// @ts-check

/**
 * @type {HTMLTextAreaElement}
 */
// @ts-ignore
const editorEl = document.getElementById('editor')

But it cannot really replace everything. TypeScript is a lock-in game.

 

Personally I haven't worked with JSDoc, but it seems interesting I will give it try.

Code of Conduct Report abuse