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

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
主站蜘蛛池模板: 电白县| 武穴市| 临武县| 封丘县| 正阳县| 革吉县| 平陆县| 平湖市| 偃师市| 霍州市| 托克托县| 会昌县| 磐安县| 工布江达县| 乌恰县| 鄱阳县| 日喀则市| 义马市| 昌黎县| 蓝山县| 呈贡县| 杭锦后旗| 大英县| 富顺县| 左云县| 酒泉市| 大石桥市| 泰宁县| 当涂县| 淮南市| 鸡泽县| 柳林县| 靖边县| 潞西市| 崇州市| 鹤岗市| 区。| 福海县| 江达县| 恩施市| 华亭县|