- Hands-On Full Stack Web Development with Angular 6 and Laravel 5
- Fernando Monteiro
- 146字
- 2021-07-23 19:18:49
Writing JavaScript code with static types
The first thing that you'll notice when working with TypeScript are its static types, in addition to all of the JavaScript types, indicated on the following table:
Primitives Objects
String Function
Number Array
Null Prototypes
Undefined
Boolean
Symbol
This means that you can declare the types of variables; it's pretty simple to assign a type to a variable. Let's look at some examples, using JavaScript types only:
function Myband () {
let band: string;
let active: boolean;
let numberOfAlbuns: number;
}
With TypeScript, we have a few more types, as we'll see in the following sections.
推薦閱讀
- 連接未來(lái):從古登堡到谷歌的網(wǎng)絡(luò)革命
- Truffle Quick Start Guide
- 5G承載網(wǎng)網(wǎng)絡(luò)規(guī)劃與組網(wǎng)設(shè)計(jì)
- Spring Boot 2.0 Projects
- TCP/IP入門(mén)經(jīng)典(第5版)
- Web Application Development with R Using Shiny
- Drush User’s Guide
- 計(jì)算機(jī)網(wǎng)絡(luò)與通信(第2版)
- Building RESTful Web services with Go
- 數(shù)字調(diào)制解調(diào)技術(shù)的MATLAB與FPGA實(shí)現(xiàn):Altera/Verilog版(第2版)
- 物聯(lián)網(wǎng)長(zhǎng)距離無(wú)線通信技術(shù)應(yīng)用與開(kāi)發(fā)
- Learning Windows 8 Game Development
- 深入理解Nginx:模塊開(kāi)發(fā)與架構(gòu)解析
- 物聯(lián)網(wǎng)導(dǎo)論
- 無(wú)線傳感器網(wǎng)絡(luò)定位方法及應(yīng)用