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

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
主站蜘蛛池模板: 聊城市| 浦城县| 通江县| 张家界市| 青浦区| 新龙县| 乌兰浩特市| 蕲春县| 县级市| 巫山县| 营山县| 陵川县| 平遥县| 哈尔滨市| 宜城市| 固阳县| 剑河县| 九龙县| 襄樊市| 遵化市| 三穗县| 禹州市| 渭南市| 临高县| 林口县| 潼南县| 屯留县| 新野县| 财经| 仪陇县| 介休市| 绥化市| 蕲春县| 天长市| 大悟县| 大庆市| 汝阳县| 乡宁县| 滦平县| 沙坪坝区| 淮滨县|