---
# System prepended metadata

title: "\U0001F3C5 Day 09 - if、else if、else 練習一"
tags: [JS 直播班 - 2024 秋季班]

---

# 🏅 Day 09 - if、else if、else 練習一

### 題目

請看完此篇文章「[if else 陳述式](https://developer.mozilla.org/zh-TW/docs/Web/JavaScript/Guide/Control_flow_and_error_handling#if...else_%E9%99%B3%E8%BF%B0%E5%BC%8F)」部分，並試著回答下面問題。

問題
---
    
請試著寫出以下情境：

範例： 如果我有 100 元，我就吃壽司，沒有就吃超商。
```javascript=
let myWallet = 200;

if(myWallet >= 100) {
 console.log('我要吃壽司');
} else {
 console.log('我吃超商');
}
```


1. 如果下雨我就坐捷運上班，沒有我就騎車上班
```javascript=
let weather = '雨天';

/* 請試著寫出判斷式 */

```

2. 如果 BMI > 24 就超重，18 ~ 24 體重正常，小於 18 過輕。（提示：補上問號部分)
```javascript=
let myBMI = 19;

/* 請試著寫出判斷式 */

if( ??? ) {
  console.log('過重');
} else if( ??? ) {
  console.log('體重正常');
} else {
  console.log('過輕');
}
 
```



## 回報流程

將答案寫在 CodePen 並複製 CodePen 連結貼至底下回報就算完成了喔! 
解答位置請參考下圖（需打開程式碼的部分觀看）

![](https://i.imgur.com/vftL5i0.png)

<!-- 解答：  

1.
```javascript=
let weather = '雨天';

if(weather === '雨天') {
 console.log('搭捷運上班');
} else {
 console.log('騎車上班');
}
```

2.
```javascript=
let myBMI = 19;

if(myBMI > 24) {
 console.log('過重');
} else if (myBMI <= 24 && myBMI >= 18){
 console.log('體重正常');
} else {
 console.log('過輕');
}
```

-->




回報區
---
| #   | Discord | CodePen / 答案 |
| --- | ----- | ----- |
| 01  | 泊岸 | [CodePen](https://codepen.io/qoq77416416/pen/OJKNMpd?editors=0012) | 
|02|朋仔|[CodePen](https://codepen.io/YPHUANG/pen/abeNwEz?editors=0011)|
|03|Jainee|[CodePen](https://codepen.io/Jainee0110/pen/oNKLQjr)|
|04|haojing|[CodePen](https://codepen.io/hjxu/pen/zYgoKwg)|
|05|Ruby|[CodePen](https://codepen.io/xivgaijl-the-selector/pen/WNVojab)|
|06|brucelee0629|[CodePen](https://codepen.io/xxhdklwi-the-decoder/pen/KKONmxV?editors=0010)|
|07|tim|[CodePen](https://codepen.io/jskrtivy-the-animator/pen/LYwbyvr?editors=0010)|
|08|邵|[Codepen](https://codepen.io/ukscrlno-the-typescripter/pen/oNKYWRM?editors=1011)|
|09|xcx100|[Codepen](https://codepen.io/c13026/pen/xxvRrKW?editors=0012)|
|10|Jack|[Codepen](https://codepen.io/kxbhixte-the-sasster/pen/qBeqjNJ?editors=0010)|
| 11    |    Celine   | [CodePen](https://codepen.io/szuning/pen/WNVojBQ) | 
| 12 | Dolce_墨 | [CodePen](https://codepen.io/DolceTseng1026/pen/PoMbjjq) | 
| 13 | Mike | [CodePen](https://codepen.io/mike2049/pen/MWNboOr?editors=0011) | 
| 14 | Lotte | [CodePen](https://codepen.io/hmkdoxuj-the-decoder/pen/KKONqyq?editors=0011) |
| 15 | anderson666 | [CodePen](https://codepen.io/goodmanbuild/pen/xxvRLvE) |
| 16 | a1phaki(小k) | [CodePen](https://codepen.io/a1phaki/pen/XWvNeeN?editors=1010) |
| 17 | 倫倫 | [CodePen](https://codepen.io/f5badapple/pen/LYwbzzO?editors=0011) |
| 18 | 是在哈囉 | [CodePen](https://codepen.io/miyxdhem-the-solid/pen/gOVLXaV) |
| 19 | ab567ab5 | [CodePen](https://codepen.io/WanTzu-Chiang/pen/bGXBYre?editors=0012) |
| 20 | 野鴿 | [CodePen](https://codepen.io/HoshinoSyouta/pen/ZEgBvWm?editors=0011) |
| 21 |   yuyeh_1212   | [CodePen](https://codepen.io/yuyeh1212/pen/ExqNodj) |
| 22 |   KOMATSU PEI   | [CodePen](https://codepen.io/Komatsu2021/pen/mdNOpmW?editors=0010) |
| 23 | GTR150 | [CodePen](https://codepen.io/Wer-Qwe/pen/WNVoMWv) | 
| 24 | JRz | [CodePen](https://codepen.io/JRZHENG/pen/yLmVKbX?editors=1111) | 
| 25 | jimmy.0706 | [CodePen](https://codepen.io/JimmyMao/pen/zYgoWzj?editors=0012) | 
| 26 | yuyuhunter_0509 | [CodePen](https://codepen.io/KRcube/pen/jOgVzWM?editors=0011) | 
| 27 |    Ariel   | [CodePen](https://codepen.io/ariel0510/pen/bGXBMeY?editors=0011) |
| 28 |    Rogan   | [CodePen](https://codepen.io/RoganHsu/pen/LYwbmLp) |
| 29 |  孫夜空 | [CodePen](https://codepen.io/sunnight0802/pen/QWeGrKm?editors=0011) | 
| 30 |  ycl325.etheddie | [CodePen](https://codepen.io/wdvikfuz-the-selector/pen/mdNOLQB) | 
| 31 | Mos | [CodePen](https://codepen.io/mos25399/pen/KKONREE?editors=0010) |
| 32 | yuling | [CodePen](https://codepen.io/yu-ling-peng/pen/gOVLjvp?editors=0011) | 
| 33 | .tszying | [CodePen](https://codepen.io/bekgnohe-the-selector/pen/OJKboMm?editors=0012) | 
| 34 | GAVI | [CodePen](https://codepen.io/qbafldcv-the-scripter/pen/xxvRarK?editors=0010)|
|35|Hailey|[Codepen](https://codepen.io/sxbokfja-the-flexboxer/pen/bGXBxrL?editors=0010)|
|  36   |   JIA    | [CodePen](https://codepen.io/nzaicwlw-the-styleful/pen/RwXoeNx?editors=0010) | 
| 37 |  mercury2508.  | [CodePen](https://codepen.io/Mercury2508/pen/bGXBxJx) |
|  38   |   610    | [CodePen](https://codepen.io/YI-LING-LIU/pen/abeBPvx) | 
|  39   |   Sonia    | [CodePen](https://codepen.io/YUJOU/pen/qBeqgZr?editors=0010) | 
|  40   |   joylu0902    | [CodePen](https://codepen.io/joylu0902/pen/NWQbomW) | 
|41|voke|[CodePen](https://codepen.io/FiSi-the-lessful/pen/JjgXKvG)|
|42|Tatsu| [CodePen](https://codepen.io/chindesu0207/pen/mdNOYqj) | 
|43|陳小廷| [CodePen](https://codepen.io/ting1124/pen/XWvNwqN?editors=0012) |
|44|jerry_669831| [CodePen](https://codepen.io/Barry-C/pen/LYwboad?editors=0111) | 
| 45 | 毛巾 | [CodePen](https://codepen.io/bqdcjboa-the-solid/pen/eYqBwQr) | 
| 46 | ABow_Chen | [CodePen](https://codepen.io/fred39392001/pen/mdNRbJp) | 
|  47   |   KUN.    | [CodePen](https://codepen.io/barry91205/pen/qBeREdz?editors=1111) | 
|  48   |   alec1203    | [CodePen](https://codepen.io/soloayaya/pen/BaXQGgp?editors=1112) | 
|  49   |   ABOOS    | [CodePen](https://codepen.io/guhungyin/pen/eYqgNQd?editors=0012) | 
|  50   |   雪粒    | [CodePen](https://codepen.io/bzykdfhw-the-bashful/pen/NWQdrXr) | 
|  51   |  zobody    | [CodePen](https://codepen.io/Zoe-Shih/pen/eYqgEyb) | 
|  52   |  Ellie    | [CodePen](https://codepen.io/Ellie-Chiang/pen/rNXjYVy) | 
|  53   |  leoli35    | [CodePen](https://codepen.io/ziku10121/pen/oNKBopQ) | 
| 54   | jing6408 | [CodePen](https://codepen.io/qqjuyjat-the-builder/pen/zYgNJWX) |
|  55  |    Emma   | [CodePen](https://codepen.io/Emma0919/pen/jOgyvKx) | 
|  56  |    Kaya   | [CodePen](https://codepen.io/kayaribi/pen/bGXgmmZ) | 
|  57  |    charlottelee   | [CodePen](https://codepen.io/char849/pen/VwoPqde) |
|  58  |    david1819   | [CodePen](https://codepen.io/David-Lin-the-vuer/pen/MWNJRrB) |
|   59  | chris      | [CodePen](https://codepen.io/chris-chen-the-selector/pen/BaXpEVd) | 
|  60   |   蘑菇星星    | [CodePen](https://codepen.io/brrrieon-the-vuer/pen/XWvMWKR) | 
|  61   |  CrystalLala | [CodePen](https://codepen.io/crystallala/pen/KKOWVzX) | 
|62|陳睿睿|[CodePen](https://codepen.io/uwmrsusb-the-solid/pen/wvVJmEB)|
| 63 | Hedwig | [CodePen](https://codepen.io/adirehfz-the-encoder/pen/jOgBzJM?editors=1111) | 
| 64 | Glen_69515 |[Codepen](https://codepen.io/glenyaochih/pen/yLmMdJN?editors=1111) | 
| 65 | Ed Huang |[Codepen](https://codepen.io/yide1986/pen/xxvqoyY) | 
| 66 | yoishere |[Codepen](https://codepen.io/yoishere/pen/XWvRmap) | 
| 67 | yu |[Codepen](https://codepen.io/yu_ch12/pen/WNVjrqX) | 
| 68 | 嚼勁先生 |[Codepen](https://codepen.io/James520284/pen/NWQjNvz) | 
| 69 | xiang5141 |[Codepen](https://codepen.io/XIANG-XIANG/pen/mdNmvLm?editors=0010) | 
| 70 | Joannehu |[Codepen](https://codepen.io/nelbabkv-the-flexboxer/pen/PoMKYbz?editors=1111) | 
|71|Avis| [CodePen](https://codepen.io/avisstian/pen/oNKeobx?editors=1011) | 
|72|Jim| [CodePen](https://codepen.io/JimChou/pen/zYgdoPy?editors=0011) | 
|73|Seris| [CodePen](https://codepen.io/Dale-Chien/pen/jOgLdBw) | 
| 74 | Ana | [CodePen](https://codepen.io/Ana-Wu/pen/GRVMdPz?editors=0011) |
| 75 | yaoling.liang | [CodePen](https://codepen.io/Yao-Ling-L-/pen/abeLaGw?editors=1012) |
| 76 |iamcan | [CodePen](https://codepen.io/uhnxswdq-the-typescripter/pen/jOgKYxL) |
| 77 | 維妮|[CodePen](https://codepen.io/Maggy-Lin/pen/eYqjmoK?editors=0010)|
| 78 | Nocab Wang ( 培根 ) |[CodePen](https://codepen.io/PeihanWang/pen/YzmROmj?editors=0011)|
|79|Ollie| [CodePen](https://codepen.io/daiyy97/pen/YzmBOvZ?editors=0011)|
|80|Amy(咂摳)|[CodePen](https://codepen.io/nnxucgmc-the-builder/pen/Jjgxzov?editors=0010)| 
|81|Kim|[CodePen](https://codepen.io/kim0101__/pen/dyxwQxG?editors=0011)| 
|82|Vivian|[CodePen](https://codepen.io/vivian-hsiao/pen/dyxxzVq)|
|83|ji3di|[CodePen](https://codepen.io/jwuuhtxh-the-builder/pen/WbewaRz?editors=0010)
|84|Satar| [CodePen](https://codepen.io/SatarKuo/pen/bNbgLzB?editors=0011) | 
|85|Chuang| [CodePen](https://codepen.io/uidoytjq-the-solid/pen/ogvGbqK) | 
|86|Anna|[Codepen](https://codepen.io/Anna-Teng/pen/gbbzGLz)
<!-- 可複製下方格式
|     |       | [CodePen]() | 
-->
