- Hands-On Full Stack Web Development with Angular 6 and Laravel 5
- Fernando Monteiro
- 79字
- 2021-07-23 19:18:50
Types: undefined and null
In TypeScript, undefined and null are types themselves; this means that undefined is a type (undefined) and null is a type (null). Confusing? undefined and null cannot be type variables; they can only be assigned as values to variables.
They are also different: a null variable means that a variable was set to null, while an undefined variable has no value assigned.
let A = null;
console.log(A) // null
console.log(B) // undefined
推薦閱讀
- 網絡云百問百答
- 黑客攻防實戰技術完全手冊:掃描、嗅探、入侵與防御
- 從區塊鏈到Web3:構建未來互聯網生態
- 5G承載網網絡規劃與組網設計
- Hands-On Chatbot Development with Alexa Skills and Amazon Lex
- Learning Karaf Cellar
- 中小型局域網組建、管理與維護實戰
- 雷達饋線技術
- 通信原理及MATLAB/Simulink仿真
- The Kubernetes Workshop
- Windows Server 2012 Hyper-V虛擬化管理實踐
- 異構蜂窩網絡關鍵理論與技術
- Hands-On Reactive Programming in Spring 5
- 黑客與反黑工具使用詳解
- 視聽變革:廣電的新媒體戰略