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)
*.js
@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.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
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
)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.