---
# System prepended metadata

title: "\U0001F3C5 Day 12 - 陣列操作應用"
tags: [JS 直播班 - 2024 秋季班]

---

# 🏅 Day 12 - 陣列操作應用

### 題目

高雄地區開始實施兵役體檢，只要符合以下其中一個條件就可以免除兵役:
1. BMI >= 35
2. 天生為扁平足 (Flatfoot)

請透過以下程式幫 Bob 判斷一下他需不需要當兵，如果需要，則用陣列方法把他加到 soldierName 陣列裡面。（補上 `...` 的部分）

```javascript=
let soldierName = ["Tom", "Nick", "John"];
let bobBmi = 22;
let isFlatfoot = false;

if(...) {
  console.log("Bob 不用當兵");
} else {
  // 將 Bob 填入國軍名單
  ...
  console.log("Bob 光榮入伍");
  console.log(`名單: ${soldierName}`);
}
```


## 回報流程

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

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

<!-- 解答：  

```
let soldierName = ["Tom", "Nick", "John"];
let bobBmi = 22;
let isFlatfoot = false;

if(bobBmi >= 35 || isFlatfoot) {
  console.log("Bob 不用當兵");
} else {
  // 將 Bob 填入國軍名單
  soldierName.push("Bob");
  console.log("Bob 光榮入伍");
  console.log(`名單: ${soldierName}`);
}
```

補充說明：
isFlatfoot 為布林值（上方的設定為 false）可以直接作為條件判斷，
若要判斷為 true (與 isFlatfoot 相反)，
可以使用 ! (反轉) => 寫成 `!isFlatfoot` 便能判斷為 true 。
-->




回報區
---
| #   | Discord | CodePen / 答案 |
| --- | ----- | ----- |
|  01   |   voke   | [CodePen](https://codepen.io/FiSi-the-lessful/pen/MWNbRMM) | 
|  02   |   Jainee  | [CodePen](https://codepen.io/Jainee0110/pen/vYoxdaW) | 
|  03   |   毛巾   | [CodePen](https://codepen.io/bqdcjboa-the-solid/pen/VwopQGz) | 
|  04   |   泊岸   | [CodePen](https://codepen.io/qoq77416416/pen/mdNWXjX?editors=0012) | 
|  05   |   david1819   | [CodePen](https://codepen.io/David-Lin-the-vuer/pen/vYoxdvp) | 
| 06 | Lobinda | [CodePen](https://codepen.io/Lobinda/pen/PoMpQxB?editors=1111) |
| 07 | ABow_Chen | [CodePen](https://codepen.io/fred39392001/pen/dyxvdEV) |
| 08 | tim | [CodePen](https://codepen.io/jskrtivy-the-animator/pen/MWNpQdY?editors=0111) |
|09|朋仔|[CodePen](https://codepen.io/YPHUANG/pen/WNVpzeB?editors=0011)|
|10|Hailey|[Codepen](https://codepen.io/sxbokfja-the-flexboxer/pen/gOVmemq?editors=0011)|
|11|Lotte|[Codepen](https://codepen.io/hmkdoxuj-the-decoder/pen/xxvqWjY?editors=0010)|
|12|Mike|[Codepen](https://codepen.io/mike2049/pen/xxvqWzY?editors=0011)|
|13|a1phaki(小k)|[CodePen](https://codepen.io/a1phaki/pen/PoMpRyM?editors=1111)|
|14|yuyuhunter_0509| [CodePen](https://codepen.io/KRcube/pen/BaXWrqa?editors=0011) |
|15|mercury2508.| [CodePen](https://codepen.io/Mercury2508/pen/wvVJmVM) |
|16|brucelee0629| [CodePen](https://codepen.io/xxhdklwi-the-decoder/pen/qBerYEQ?editors=0011) | 
| 17    | 雪粒      | [CodePen](https://codepen.io/bzykdfhw-the-bashful/pen/dyxvemb) | 
|18|陳睿睿|[CodePen](https://codepen.io/uwmrsusb-the-solid/pen/KKOWRJR?editors=0011)|
|19|ABOOS| [CodePen](https://codepen.io/guhungyin/pen/wvVJxob?editors=0012) | 
|  19   |   610    | [CodePen](https://codepen.io/YI-LING-LIU/pen/PoMpyNJ) |
| 20 | Mos |[Codepen](https://codepen.io/mos25399/pen/oNKZaPZ?editors=0010)|
| 21 | 倫倫 |[Codepen](https://codepen.io/f5badapple/pen/ExqWOgW?editors=0011)|
|22|邵|[Codepen](https://codepen.io/ukscrlno-the-typescripter/pen/GRVWwrw?editors=0011)|
|23 |  KUN.  | [CodePen](https://codepen.io/barry91205/pen/vYoxvaN?editors=1111) | 
|24 |  jimmy.0706  | [CodePen](https://codepen.io/JimmyMao/pen/mdNWvpB?editors=0012) | 
|25 |  JRz  | [CodePen](https://codepen.io/JRZHENG/pen/abeJXEv?editors=1111) |
| 26 | yuyeh_1212 | [CodePen](https://codepen.io/yuyeh1212/pen/zYgZbzw) |
| 27 | yuling | [CodePen](https://codepen.io/yu-ling-peng/pen/YzmZgxj?editors=0011) | 
| 28 | Kaya | [CodePen](https://codepen.io/kayaribi/pen/KKOWELN) | 
| 29 | GTR150 | [CodePen](https://codepen.io/Lobinda/pen/PoMpQxB?editors=1111) | 
| 30 | Sonia | [CodePen](https://codepen.io/YUJOU/pen/GRVWLNg?editors=0011) |
| 31 | Jack | [CodePen](https://codepen.io/kxbhixte-the-sasster/pen/NWQpVVo?editors=0110) |
|  32   |   Chris    | [CodePen](https://codepen.io/chris-chen-the-selector/pen/JjgWQEy?editors=0010) | 
| 33    |    JIA   | [CodePen](https://codepen.io/nzaicwlw-the-styleful/pen/QWepeNd?editors=0010) | 
| 34    |     Celine  | [CodePen](https://codepen.io/szuning/pen/JjgWgyx) | 
|  35  | jerry_66983      | [CodePen](https://codepen.io/Barry-C/pen/JjgNYLM?editors=1111) | 
|  36  | yoishere      | [CodePen](https://codepen.io/yoishere/pen/RwXVWOd) |
|  37  | .tsz_ying      | [CodePen](https://codepen.io/bekgnohe-the-selector/pen/WNVjrPZ?editors=0012) |
|38|陳小廷|[CodePen](https://codepen.io/ting1124/pen/QWevEPy)|
| 39 | Glen_69515 |[Codepen](https://codepen.io/glenyaochih/pen/rNXmWMb?editors=1111)|
|  40   |  CrystalLala     | [CodePen](https://codepen.io/crystallala/pen/ExqmZWZ )| 
|  41   |  是在哈囉     | [CodePen](https://codepen.io/miyxdhem-the-solid/pen/BaXRwaR?editors=1111 )| 
|  42   |  Rogan     | [CodePen](https://codepen.io/RoganHsu/pen/mdNmBpw?editors=1111 )| 
|  43   |  haojign     | [CodePen](https://codepen.io/hjxu/pen/YzmpdZq)| 
| 44 | GAVI | [CodePen](https://codepen.io/qbafldcv-the-scripter/pen/QWevamv?editors=0010)| 
| 45 | Dolce_墨 | [CodePen](https://codepen.io/DolceTseng1026/pen/GRVmYZN)| 
| 46 | 嚼勁先生 | [CodePen](https://codepen.io/James520284/pen/poMPQBy)| 
| 47 | ab567ab5 | [CodePen](https://codepen.io/WanTzu-Chiang/pen/yLmbGYg?editors=0012)|
| 48 | Ruby | [CodePen](https://codepen.io/xivgaijl-the-selector/pen/BaXRvKy) |
|  49   |  alec1203     | [CodePen](https://codepen.io/soloayaya/pen/jOgwbYg?editors=1112)| 
|   50  |    Ariel   | [CodePen](https://codepen.io/ariel0510/pen/eYqRBVx?editors=0011 )|
|   51  |    kaka_945   | [CodePen](https://codepen.io/kay945/pen/ExqXZmy )|
|52|Tatsu| [CodePen](https://codepen.io/chindesu0207/pen/xxvrLMQ)| 
|  53   |   Emma   | [CodePen](https://codepen.io/Emma0919/pen/poMrrBe)| 
|  54   |   蘑菇星星    | [CodePen](https://codepen.io/brrrieon-the-vuer/pen/QWeMOWx?editors=0012 )| 
|  56   |   Joannehu    | [CodePen](https://codepen.io/nelbabkv-the-flexboxer/pen/QWeMaxy?editors=1111 )| 
|  57   |   野鴿    | [CodePen](https://codepen.io/HoshinoSyouta/pen/jOgLvxW?editors=0011 )| 
|  58   |   Seris    | [CodePen](https://codepen.io/Dale-Chien/pen/jOgLdQZ)| 
| 59 | Jim | [CodePen](https://codepen.io/JimChou/pen/VwoMmeR?editors=0011) |
|  60   |   Ed Huang    | [CodePen](https://codepen.io/yide1986/pen/qBePqYw)| 
|  61  |  Ana  | [CodePen](https://codepen.io/Ana-Wu/pen/OJKxZgr?editors=0011)| 
|  62  | yaoling.liang | [CodePen](https://codepen.io/Yao-Ling-L-/pen/OJKxYWP?editors=1011)| 
|  63  | xiang5141 | [CodePen](https://codepen.io/XIANG-XIANG/pen/bGXYeJK?editors=0010)| 
|  64  | yu | [CodePen](https://codepen.io/yu_ch12/pen/oNKowjK)| 
|  65  | joylu0902 | [CodePen](https://codepen.io/joylu0902/pen/yLmPvwz)| 
|  66  | Yen | [CodePen]( https://codepen.io/yuxxxlouyen/pen/vYojpBq?editors=0011)|
| 67   | Hedwig | [CodePen](https://codepen.io/adirehfz-the-encoder/pen/LYwrPZp?editors=0011)| 
| 68   | charlottelee | [CodePen](https://codepen.io/char849/pen/vYorpKw)|
|69|維妮|[CodePen](https://codepen.io/Maggy-Lin/pen/KKOBpme?editors=1010)|
|70|iamcan|[CodePen](https://codepen.io/uhnxswdq-the-typescripter/pen/yLmxwRm)|
|71|zobody|[CodePen](https://codepen.io/Zoe-Shih/pen/vYozqvW)|
|72|KOMATSU PEI|[CodePen](https://codepen.io/Komatsu2021/pen/eYqPMjq?editors=0012)|
|73| Nocab Wang ( 培根 )|[CodePen](https://codepen.io/PeihanWang/pen/LYwMbmJ?editors=0011)|
|74|Amy(咂摳)|[CodePen](https://codepen.io/nnxucgmc-the-builder/pen/ExqrJVJ?editors=0011)| 
|75|Kim|[CodePen](https://codepen.io/kim0101__/pen/zxOOQEj?editors=0011)| 
|76|Satar|[CodePen](https://codepen.io/SatarKuo/pen/RNbKMwP?editors=0011)| 
|77|ji3di|[CodePen](https://codepen.io/jwuuhtxh-the-builder/pen/VYZpgpd?editors=0011)
|78|Chuang|[CodePen](https://codepen.io/uidoytjq-the-solid/pen/JoPpraV?editors=0011)




<!-- 可複製下方格式
|     |       | [CodePen]( )| 
-->
