- 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.
推薦閱讀
- 智慧城市:大數(shù)據(jù)、互聯(lián)網(wǎng)時(shí)代的城市治理(第4版)
- Web安全防護(hù)指南:基礎(chǔ)篇
- 工業(yè)控制網(wǎng)絡(luò)安全技術(shù)與實(shí)踐
- 社交電商運(yùn)營策略、技巧與實(shí)操
- 重新定義Spring Cloud實(shí)戰(zhàn)
- TCP/IP入門經(jīng)典(第5版)
- 網(wǎng)絡(luò)安全技術(shù)與解決方案(修訂版)
- PLC、現(xiàn)場總線及工業(yè)網(wǎng)絡(luò)實(shí)用技術(shù)速成
- 圖解手機(jī)元器件維修技巧
- CCNP TSHOOT(642-832)認(rèn)證考試指南
- 一本書讀懂TCP/IP
- 物聯(lián)網(wǎng)M2M開發(fā)技術(shù):基于無線CPU-Q26XX
- 區(qū)塊鏈社區(qū)運(yùn)營手冊
- 視聽變革:廣電的新媒體戰(zhàn)略
- 物聯(lián)網(wǎng)商業(yè)設(shè)計(jì)與案例