官术网_书友最值得收藏!

What is TypeScript?

The TypeScript language looks like JavaScript; it is JavaScript with type annotations added to it. The TypeScript compiler has two main features: it is a transpiler and a type checker. A transpiler is a special form of compiler that outputs source code. In case of the TypeScript compiler, TypeScript source code is compiled to JavaScript code. A type checker searches for contradictions in your code. For instance, if you assign a string to a variable, and then use it as a number, you will get a type error.

The compiler can figure out some types without type annotations; for others you have to add type annotations. An additional advantage of these types is that they can also be used in editors. An editor can provide completions and refactoring based on the type information. Editors such as Visual Studio Code and Atom (with a plugin, namely atom-typescript) provide such features.

主站蜘蛛池模板: 正阳县| 扎鲁特旗| 大埔区| 鄯善县| 资源县| 湖南省| 界首市| 浪卡子县| 清水县| 商河县| 北辰区| 兴山县| 河曲县| 从化市| 黄冈市| 驻马店市| 闽清县| 九台市| 兴业县| 新野县| 岑巩县| 武宁县| 南召县| 普安县| 柳林县| 扎囊县| 五峰| 桐乡市| 静安区| 大英县| 金门县| 分宜县| 元江| 新民市| 麻阳| 南康市| 南投县| 噶尔县| 通河县| 根河市| 天全县|