网页
综合
更新时间 2026-11-14 03:58:21
TypeScript: JavaScript With Syntax For Types.
自动蜘蛛
www.typescriptlang.org
正文约 2005 字
TypeScript is a strongly typed programming language that builds on JavaScript, giving you better tooling at any scale.
TypeScript 7.0 is now available, 7.1 is currently in beta.
TypeScript adds additional syntax to JavaScript to support a tighter integration with your editor. Catch errors early in your editor.
TypeScript code converts to JavaScript, which runs anywhere JavaScript runs: In a browser, on Node.js, Deno, Bun and in your apps.
TypeScript understands JavaScript and uses type inference to give you great tooling without additional code.
Apply types to your JavaScript project incrementally, each step improves editor support and improves your codebase.
Let's take this incorrect JavaScript code, and see how TypeScript can catch mistakes in your editor.
No editor warnings in JavaScript filesThis code crashes at runtime!
Adding this to a JS file shows errors in your editor
the param is arr, not orr!
JavaScript with TS Check
Using JSDoc to give type information
Now TS has found a bad call. Arrays have slice, not trim.
JavaScript with JSDoc
TypeScript adds natural syntax for providing types
Describe the shape of objects and functions in your code.
Making it possible to see documentation and issues in your editor.
First, we were surprised by the number of small bugs we found when converting our code.
Second, we underestimated how powerful the editor integration is.
TypeScript was such a boon to our stability and sanity that we started using it for all new code within days of starting the conversion.
Felix Rieseberg at Slack covered the transition of their desktop app from JavaScript to TypeScript in their blog
Voted 2nd most loved programming language in the Stack Overflow 2020 Developer survey
TypeScript was used by 78% of the 2020 State of JS respondents, with 93% saying they would use it again.
TypeScript was given the award for “Most Adopted Technology” based on year-on-year growth.
Made with ♥ in Redmond, Boston, SF & Dublin
© 2012-2026 MicrosoftPrivacyTerms of Use
本页为82搜索生成的网页快照,内容来自站内索引;演示数据的原文链接仅作示例。