---
# System prepended metadata

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

---

---
tags: JS 直播班 - 2023 秋季班
---
# 🏅 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 / 答案                           |
|:-------------:|:------------------------------------------------------------------:|
|     風羽      |  [CodePen](https://codepen.io/Joy-Huang/pen/qBLeXGp?editors=0011)  |
|    詹姆士     |         [CodePen](https://codepen.io/z111048/pen/BavXPmd)          |
|   kuanju27    |        [CodePen](https://codepen.io/Eero-Chiao/pen/xxmvJpv)        |
|    pinyi_9    |    [CodePen](https://codepen.io/Wpypy/pen/jOXgpZx?editors=1111)    |
|     kawa      |   [CodePen](https://codepen.io/z83xji6/pen/OJrKwEj?editors=0010)   |
|   Lychee KK   |         [CodePen](https://codepen.io/kakakala/pen/ExGqpRq)         |
| yaoling.liang | [CodePen](https://codepen.io/Yao-Ling-L-/pen/PoXMBaj?editors=1111) |
|  runweiting   |        [CodePen](https://codepen.io/weiting14/pen/qBLeyMd)         |
|    銀光菇     |      [CodePen](https://codepen.io/genesynthesis/pen/YzdmjoZ)       |
|       Ivy    |    [Codepen](https://codepen.io/Irene-Ke/pen/poqMZmq?editors=1010)  |
|  ShangChu    |    [Codepen](https://codepen.io/shangchu0412/pen/poqMOvY?editors=0011)  |
| yuan! | [CodePen](https://codepen.io/townyuan/pen/YzdmOPV) |
| CPing | [CodePen](https://codepen.io/CPing/pen/NWeQLqL) |
| Fabio20 | [CodePen]([網址](https://codepen.io/fabio7621/pen/yLGmxad)) |
| judy123 | [CodePen](https://codepen.io/tsong-h/pen/LYMwJRx?editors=1011) |
| 阿榮|[Codepen](https://codepen.io/codeitaday/pen/qBLeMRR?editors=0010)|
| MDFK |[Codepen](https://codepen.io/maywang/pen/mdaNwPP)|
| xiaokui_71292 | [Codepen](https://codepen.io/pen?template=oNJKPew)|
| Helen | [Codepen](https://codepen.io/milkteamonster/pen/WNLVgRP?editors=1010)|
| santu0868  | [CodePen](https://codepen.io/HatsumiSan/pen/VwqoGyr?editors=1111)|
| 依依  | [CodePen](https://codepen.io/Rita-Yang/pen/abPeaaJ?editors=0011)|
|Moreene|[CodePen](https://codepen.io/Moreene/pen/zYygJeN)|
| Eden | [Codepen](https://codepen.io/iseden/pen/gOZVjyG)|
| Lainie | [Codepen](https://codepen.io/Lainie88/pen/OJrKBLG?editors=0011)|
| Mattie | [CodePen](https://codepen.io/mattielin/pen/YzdmOmj) |
| claire | [CodePen](https://codepen.io/yi-wen-chen/pen/JjwgmoM) |
| yuan2781 | [CodePen](https://codepen.io/ismebir/pen/yLGmRVV) |
| Andy | [CodePen](https://codepen.io/andy31342/pen/VwqoEPV?editors=0010) |
| zona | [CodePen](https://codepen.io/w242920/pen/zYygmEp?editors=1111) |
| 小夏 | [CodePen](https://codepen.io/michaelhsia/pen/yLGmRvb) |
| 維哲 | [CodePen](https://codepen.io/kwz1202/pen/mdaNzLN) |
| Morning | [CodePen](https://codepen.io/sxzjnkxs-the-styleful/pen/QWzeZJd?editors=0011) |
| cest_jessie | [CodePen](https://codepen.io/itsjessiechen/pen/wvRVYQG) |
| 一畫 | [CodePen](https://codepen.io/YH-K-the-selector/pen/GRPVYzg) |
| shuuu | [CodePen](https://codepen.io/afjrvjzl-the-bashful/pen/qBLeJev?editors=1011https://codepen.io/afjrvjzl-the-bashful/pen/qBLeJev?editors=1011https://codepen.io/afjrvjzl-the-bashful/pen/qBLeJev?editors=1011) |
| Uli | [CodePen](https://codepen.io/uli1313/pen/LYMwgva?editors=0011) |
| ann6212 | [CodePen](https://codepen.io/yqmegupa-the-styleful/pen/jOXgQOL) |
| RX00 | [CodePen](https://codepen.io/llqzknqv-the-styleful/pen/eYbqQJj?editors=0011) |
| yuling | [CodePen](https://codepen.io/igzdflpu/pen/bGOXQBR) |
| phyllis_0802 | [CodePen](https://codepen.io/Phyllis-Cheng/pen/QWzeJga) |
| Winnie | [CodePen](https://codepen.io/codepen-io-winnie/pen/zYygJXZ?editors=0011)|
| Ching | [CodePen](https://codepen.io/tzuchingg/pen/gOZVQGg?editors=0011)|
| 蛋塔 | [CodePen](https://codepen.io/Hong-Game1/pen/ExGqOMY)|
| Allen | [CodePen](https://codepen.io/hlctw/pen/MWZNBLx)|
| Alyce | [CodePen](https://codepen.io/alycehwy/pen/qBLeLBZ?editors=0010)|
| tanuki5863 | [CodePen](https://codepen.io/tanuki320/pen/poqMGNE?editors=1111) |
| shcopy | [CodePen](https://codepen.io/shcopy/pen/oNJKmzM) |
| 精靈 | [CodePen](https://codepen.io/justafairy/pen/oNJKmPm?editors=0011) |
| 凱恩 | [CodePen](https://codepen.io/Royen0506/pen/xxmvMmy?editors=1111) |
| Ataraxia | [CodePen](https://codepen.io/ataraxia8888/pen/vYvQPQY) |
| penny_41707 | [CodePen](https://codepen.io/penny-wang-the-flexboxer/pen/qBLevme) |
| ming0712 | [CodePen](https://codepen.io/StevenHuang/pen/Jjwgzmo?editors=0010) |
| 奔跑吧(GTR150) | [CodePen](https://codepen.io/Wer-Qwe/pen/VwqoNrM) |
| SHUO | [CodePen](https://codepen.io/xrzarxkl-the-reactor/pen/mdaNgNz) |
| xin | [CodePen](https://codepen.io/Estherrrrrr999/pen/KKbOYQO) |
| ⭐️小正 | [CodePen](https://codepen.io/colorgolden/pen/yLGmdpq) |
| Rxzan | [CodePen](https://codepen.io/Tzuru-Chen/pen/QWzeXqa) |
| 荷菓かのり | [CodePen](https://codepen.io/oogxwkvw-the-builder/pen/jOXgjra?editors=0012) |
| jimmy.0706 | [CodePen](https://codepen.io/WeiJun-Mao/pen/qBLeeEZ) |
| smalljie | [CodePen](https://codepen.io/smalljie/pen/QWzeepY) |
| Jun_ | [CodePen](https://codepen.io/Jun-L/pen/yLZBBga) |
| 保羅 | [CodePen](https://codepen.io/paul-1997/pen/YzBKKZR?editors=0011) |
| JasonFU | [CodePen](https://codepen.io/jie-Fu/pen/gOqYYQO) |
| Tina02 | [CodePen](https://codepen.io/chjitlox-the-bashful/pen/BaMBaBz) |
| yu.t_liu | [CodePen](https://codepen.io/YuT200053/pen/NWoKWGp?editors=0011) |
| LinaChen | [CodePen](https://codepen.io/LinaChen/pen/oNmvNpg) |
| gebyman | [CodePen](https://codepen.io/gebyman/pen/abXobKg?editors=0012) |
| Zem | [CodePen](https://codepen.io/Potoro/pen/gOqYbMo) |
| Rogan | [CodePen](https://codepen.io/RoganHsu/pen/PoVYwNQ) |
| shiro | [CodePen](https://codepen.io/chenghsienwang/pen/vYbBEQR) |
| MY | [CodePen](https://codepen.io/ahmomoz/pen/VwgZLaB)
| IRIS | [CodePen](https://codepen.io/sz594380/pen/eYxONZg?editors=0010)
| hsuanlee1084 | [CodePen](https://codepen.io/hsuanlee1024/pen/JjxPGrb?editors=1010)
| dora | [CodePen](https://codepen.io/dorayu/pen/OJdLMJz?editors=1011) |
| Peng | [CodePen](https://codepen.io/H-Peng/pen/poGzPdE?editors=0010) |
| Leo | [CodePen](https://codepen.io/Aruminiya/pen/zYeOdPv) |
| Oria | [CodePen](https://codepen.io/kajing/pen/BaMBwWg?editors=0010) |
| kebukeyi | [CodePen](https://codepen.io/kebukeyi/pen/poGzWBP) |
| minnielin | [CodePen](https://codepen.io/ShengXin-Lin/pen/qBgWVyW) |
| jiayu | [CodePen](https://codepen.io/fjqxaznl-the-reactor/pen/qBgWKRp?editors=0010) |
| Vivian2857 | [CodePen](https://codepen.io/uojbohed-the-solid/pen/abXoaYN?editors=0010) |
| nini1202desu | [CodePen](https://codepen.io/tvxq5206/pen/KKbOqbr) |
|OSN|[Codepen](https://codepen.io/osncodepen/pen/MWLgzaO?editors=1111)|
|celinelinnn|[CodePen](https://codepen.io/celinephoebe/pen/abPerEY)|
|克里夫 Cliff | [CodePen](https://codepen.io/lanfbaea-the-animator/pen/bGzbXGa?editors=1111)|
|Yijing | [CodePen](https://codepen.io/Yi-Jing-71080635/pen/LYqPwXW?editors=0011)|
|郭芙蘭#6374 | [CodePen](https://codepen.io/flora_Kuo/pen/abXbodJ?editors=1011)|
| 辣椒 | [Codepen](https://codepen.io/chilichen118/pen/YzBzKLJ) ||
| Noah | [Codepen](https://codepen.io/lch1222/pen/poGooxL?editors=1111) |
| davidtt | [Codepen](https://codepen.io/David-Tsai/pen/oNmNNmN?editors=0011) |
| shcopy | [CodePen](https://codepen.io/shcopy/pen/oNJKmzM) |
| _shun0130 | [CodePen](https://codepen.io/koba60052ww/pen/QWYWaxJ?editors=0011) |
| hsu0921 | [CodePen](https://codepen.io/HSUANIN0327/pen/GRzRQqB) |
| 楓仔 | [CodePen](https://codepen.io/maplestartend/pen/XWOWxqM?editors=1112) |
| Zhu | [CodePen](https://codepen.io/codepenplayer/pen/OJdJBGK) |
| damon0323 | [CodePen](https://codepen.io/swk9eny2/pen/YzBzRNM?editors=0010) |
| Chia Pin | [CodePen](https://codepen.io/joker-cat/pen/vYbYvXK) |
| xuan#0808 | [CodePen](https://codepen.io/xuan0915/pen/abXbPOr?editors=0012) |
| Daylily | [CodePen](https://codepen.io/daylily/pen/WNPNBpB) |
| hsiu8767 | [CodePen](https://codepen.io/hsiu8767/pen/MWLYvEP?editors=0011)
|Joy chiang | [CodePen](https://codepen.io/fwysphbw-the-vuer/pen/ZEwYxEB?editors=0011) |
|sponge | [CodePen](https://codepen.io/biunpujm-the-flexboxer/pen/NWoPYVp?editors=1010) |
|hank._.z| [Codepen](https://codepen.io/linoiaby-the-sans/pen/LYqEgWW)
| hsuhsusophie | [CodePen](https://codepen.io/hsuhsusophie/pen/eYxmPMJ?editors=0012)
| 阿賀#3700 | [CodePen](https://codepen.io/sungho/details/vYbOgEa)
|白夜|[CodePen](https://codepen.io/Wei903/pen/MWLaggz?editors=0011)
|         Jerry | [CodePen](https://codepen.io/ildkosxk-the-encoder/pen/zYevOVB)|
|小廷|[CodePen](https://codepen.io/uyxkiake-the-selector/pen/MWLawwZ?editors=0011)
| QOO#8446 | [CodePen](https://codepen.io/QOOQOOQ/pen/GRPVeQr?editors=0012) |
| 歐陽龍龍#1061 | [CodePen](https://codepen.io/dizzydog-rgb/pen/KKJdaeV) |
| ss585801 | [CodePen](https://codepen.io/ss585801/pen/poGjeJe?editors=0011) |
| skypassion5000 | [CodePen](https://codepen.io/skypassion5000/pen/KKJdJWB?editors=0010) |
| Befun | [CodePen](https://codepen.io/richard260572/pen/zYevgJJ?editors=0011) |
| 阿維#2569 | [CodePen](https://codepen.io/iijojpli-the-looper/pen/xxMZmOY?editors=0011) |
| peggy | [CodePen](https://codepen.io/peggylai/pen/dyaGEeY?editors=0011) |
| Iris | [CodePen](https://codepen.io/iris831206/pen/YzBwoyV) |
|Cosmos | [CodePen](https://codepen.io/violet7755/pen/vYbXazy) |
|_Luna | [CodePen](https://codepen.io/sfctsolp-the-sasster/pen/BaMpqPg?editors=0010) |
| Rochel |[Codepen](https://codepen.io/rochelwang1205/pen/wvNdPBb?editors=1111)|
| ChrisSQR | [CodePen](https://codepen.io/ChrisSQR/pen/KKJyqgx) |
| macihuang | [CodePen](https://codepen.io/macy1215/pen/vYbjeMV?editors=1011) |
| bf_tsai | [CodePen](https://codepen.io/BF-Tsai/pen/jOdpRVy) |
| NathanJames | [CodePen](https://codepen.io/ufo060204/pen/RwvYxLz) |
| 雪維 | [Codepen](https://codepen.io/Shawey/pen/OPLZvMN) |
<!--
| 名稱 | [CodePen]([網址]) |
-->
