[Tools] Unlock TypeScript's Features in Vanilla JS with @ts-check and JSDoc

2023-06-02,,

TypeScript can help you with your plain JavaScript files if you add a simple //@ts-check comment. Then you can enhance the experience by add proper JSDocs to describe your functions which will feed type information into TypeScript and give you a development experience near TypeScript itself.

//@ts-check

/**
* @param {string} greeting
* @return {string}
*/
function greeting (greeting) {
return greeting
} greeting()

[Tools] Unlock TypeScript's Features in Vanilla JS with @ts-check and JSDoc的相关教程结束。

《[Tools] Unlock TypeScript's Features in Vanilla JS with @ts-check and JSDoc.doc》

下载本文的Word格式文档,以方便收藏与打印。