###### tags: `JavaScript` `學習` # 變數:布林、undefined、null {%hackmd BJrTq20hE %} ## 布林 boolean是一種型別,有true與false,簡單的來說就是讓電腦知道是、否的狀態。 ```javascript= console.log(3>1);//true ``` ## undefined 在變數中是尚未賦予值。 ```javascript= let a ; console.log(a);//undefined console.log(typeof a)//undefined ``` 使用typeof 型別是undefined ## null 有被賦值,是空值。 在需要清空記憶體資料時會用到 ```javascript= let a = 5; a = null console.log(a)//null ``` 資料就被清空
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up