- 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.
推薦閱讀
- 網(wǎng)絡(luò)教育學(xué)習(xí)指導(dǎo)
- 從區(qū)塊鏈到Web3:構(gòu)建未來(lái)互聯(lián)網(wǎng)生態(tài)
- JBoss EAP6 High Availability
- 城域網(wǎng)與廣域網(wǎng)(第2版)
- Learning Swift(Second Edition)
- 光纖通信系統(tǒng)與網(wǎng)絡(luò)(修訂版)
- 網(wǎng)絡(luò)安全應(yīng)急響應(yīng)技術(shù)實(shí)戰(zhàn)指南
- 端到端QoS網(wǎng)絡(luò)設(shè)計(jì)
- 數(shù)據(jù)血緣分析原理與實(shí)踐
- 物聯(lián)網(wǎng)的機(jī)遇與利用
- Laravel Application Development Cookbook
- 工業(yè)以太網(wǎng)技術(shù):AFDX/TTE網(wǎng)絡(luò)原理、接口、互連與安全
- Cisco無(wú)線局域網(wǎng)配置基礎(chǔ)
- 物聯(lián)網(wǎng)概論
- 智慧的物聯(lián)網(wǎng):感知中國(guó)和世界的技術(shù)