--- tags: TypeScript 新手指南 --- # #1 簡介、原始資料型別、任意值、型別推論 > 討論日期: 2021/10/26 > 討論範圍: 新手指南:簡介、基礎前三章節 (原始資料型別、任意值、型別推論) ## 筆記分享 - https://dazedbear.notion.site/1-1017d22dacf349d88f77a0666b205708 ## 待解決問題 - none ## 線上討論紀錄 ### Any - 實務上為求快速開發,常會先使用 [any](https://willh.gitbook.io/typescript-tutorial/basics/any) 來讓型別檢查通過,等後續要上線前才回頭處理型別定義的問題 - 通常是全新的專案會直接用 TypeScript,較少遇到專案是 JavaScript migrate 到 TypeScript ### TypeScript 編譯 - 只會進行靜態檢查,編譯時就會報錯,但仍會產生 JavaScript 檔 - 編譯後的 JavaScript 檔轉成 [ES5](https://www.wikiwand.com/en/ECMAScript) 以下相容的語法,但不會經過 [minify](https://www.cloudflare.com/zh-tw/learning/performance/why-minify-javascript-code/)  ### @types https://github.com/DefinitelyTyped/DefinitelyTyped 一個 [npm scope](https://docs.npmjs.com/about-scopes) 收集了常見的第三方 library type definitions,這些 package 只有單純的 `index.d.ts` type definitions file,並沒有 source code 在內 > ex: [@types/react](https://www.npmjs.com/package/@types/react), [react](https://www.npmjs.com/package/react)
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up