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

Chapter 2. TypeScript Basics

One of the primary benefits of compiled languages is that they provide a more plain syntax for the developer to work with before the code is eventually converted to machine code. TypeScript is able to bring this advantage to JavaScript development by wrapping several different patterns into language constructs that allow us to write better code. We have talked a little bit about the static type system that TypeScript adds on top of JavaScript. Every explicit type annotation that is provided is simply syntactic sugar that will be removed during compilation, but not before their constraints are analyzed and any errors are caught. In this chapter, we will explore this type system in depth. We will also discuss the different language structures that TypeScript introduces. We will look at how these structures are emitted by the compiler into plain JavaScript. This chapter will contain a detailed look at each of these concepts:

  • Types
  • Functions
  • Interfaces
  • Classes
  • Enums
  • Modules
  • Generic types
主站蜘蛛池模板: 大渡口区| 兴业县| 井研县| 本溪| 绿春县| 天水市| 千阳县| 武夷山市| 永和县| 大姚县| 铜陵市| 南投县| 确山县| 于田县| 安庆市| 兴文县| 龙口市| 英德市| 石泉县| 玉田县| 宿州市| 清远市| 丁青县| 长沙市| 清水县| 保定市| 青浦区| 日喀则市| 阳原县| 广平县| 灵丘县| 大兴区| 泗阳县| 繁昌县| 达拉特旗| 义乌市| 合肥市| 微博| 汕尾市| 新乡市| 虎林市|