# JS 環境與變數環境-第一關 **第 1 題** ``` 題目: // 1.產生 console.log 從上到下的值為? // 2.出現幾個變數、型別、記憶體物件? var a ; a = 1; a = "hello"; console.log(a) 解答: 1. "hello" 2. 1個變數(a) 2個型別(分別為number/string) 3個記憶體物件(從上到下依序產生了 undefined/1/hello) ``` **第 2 題** ``` 題目: // 1.產生 console.log 從上到下的值為? // 2.出現幾個變數、型別、記憶體物件? var b = 3 ; var c = 4; console.log(d) var d = b+c; console.log(d) 解答: 1. undefined 7 2. 3個變數(b,c,d) 1個型別(number) 6個記憶體物件(undefined/undefined/undefined/3/4/7) ``` **第 3 題** ``` 題目: // 1.產生 console.log 從上到下的值為? // 2.出現幾個變數、型別、記憶體物件? console.log(e) var e; e = 5; e = "hello" e = true; console.log(e) 解答: 1. undefined true 2. 1個變數(e) 3個型別(number/string/boolean) 4個記憶體物件(undefined/5/"hello"/true) ``` **第 4 題** ``` 題目: // 1.產生 console.log 從上到下的值為? // 2.出現幾個變數、型別、記憶體物件? var f = 10; var s = 6; f = 5; f = "haha"; console.log(s); 解答: 給大家練習囉~ ```
×
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