# 變數及物件屬性的差異 --- ## 變數無法被刪除,屬性才可以 ``` =javascript var a = 1; b = 2; console.log(window); //可以看到a跟b都有出現 delete a ; delete b ; console.log(window); //a還存在但b被刪除了 console.log(a); // 1 console.log(b); // undefined //原因: a是變數,而b只是屬性(window.b),所以變數無法被刪除,屬性可以。 ```
×
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