- 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.
推薦閱讀
- 數字烏托邦
- Hands-On Chatbot Development with Alexa Skills and Amazon Lex
- 計算機網絡與數據通信
- 計算機網絡安全實訓教程(第二版)
- 農產品物聯網研究與應用
- 互聯網安全的40個智慧洞見:2015年中國互聯網安全大會文集
- 中國互聯網發展報告2018
- 智慧光網絡:關鍵技術、應用實踐和未來演進
- Unity Artificial Intelligence Programming
- Bonita Open Solution 5.x Essentials
- 網絡綜合布線(第2版)
- Getting Started with tmux
- 圖神經網絡前沿
- 5G智慧交通
- 趣話通信:6G的前世、今生和未來