---
# System prepended metadata

title: "\U0001F3C5 JS 任務 Day4 - 比較與邏輯運算子"
tags: [軟體工程師體驗營 - 2024]

---

---
tags: 軟體工程師體驗營 - 2024
---

# 🏅 JS 任務 Day4 - 比較與邏輯運算子

## 提示
1. [MDN：運算式與運算子](https://developer.mozilla.org/zh-TW/docs/Web/JavaScript/Guide/Expressions_and_Operators)

### 題目一：比大小
``` =JavaScript
// input 輸入
higher(3,2)
higher(100,299)
higher(8,2.5)
// output 輸出
true
false
true
```

### 題目二：布林反轉
:::spoiler 提示(點擊箭頭顯示)
* [! NOT 反轉](https://developer.mozilla.org/zh-TW/docs/Web/JavaScript/Guide/Expressions_and_Operators#%E9%82%8F%E8%BC%AF%E9%81%8B%E7%AE%97%E5%AD%90)
:::
``` =JavaScript
// input 輸入
booleanToggle(true)
booleanToggle(false)
// output 輸出
false
true
```

### 題目三：型別判斷
``` =JavaScript
// input 輸入
checkType(3.33)
checkType("Hello")
checkType(true)
checkType([1,2,3])
// output 輸出
"number"
"string"
"boolean"
"object"
```

### 題目四：打八折後，是否總價大於 100 元
``` =JavaScript
// input 輸入
onSale(200)
onSale(150)
onSale(125)
onSale(100)
// output 輸出
true
true
false
false
```


### 題目五：是否大於 200，且符合會員條件
``` =JavaScript
// input 輸入
checkVIP(300,true)
checkVIP(0,true)
checkVIP(30000,false)
checkVIP(888,true)
// output 輸出
true
false
false
true
```


## 回報流程

1. 將答案貼在 Codepen 並複製 Codepen 連結貼至「回報區」回報
（也可以將答案直接貼至「回報區」）

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


回報區
---

| 報數 |  Discord 名字   |                                                 Codepen／其他回饋                                                 |
|:----:|:---------------:|:-----------------------------------------------------------------------------------------------------------------:|
|  1   |      jerry      |                               [Codepen](https://codepen.io/sony791210/pen/yLrrWZr)                                |
|  2   |     詹姆士      |                                  [Codepen](https://codepen.io/pen/?editors=1111)                                  |
|  03  |       Aya       |                               [Codepen](https://codepen.io/NoNameNote/pen/KKYYjKY)                                |
|  04  |     Daphne      |                         [Codepen](https://codepen.io/DaphneShen/pen/eYoowpm?editors=0012)                         |
|  05  |   zaoannihao    |                           [Codepen](https://codepen.io/ckhwdvrx-the-solid/pen/vYMMqxR)                            |
|  06  |      Larry      |                         [Codepen](https://codepen.io/larrylinr5/pen/ExJJBoW?editors=1112)                         |
|  7   |     LGJason     |                                 [Codepen](https://codepen.io/j811108/pen/xxeeoWr)                                 |
|  8   |  Michelle0417   |                              [Codepen](https://codepen.io/michelle0417/pen/MWRRMva)                               |
|  9   |      yuan!      |                                [Codepen](https://codepen.io/townyuan/pen/VwNNJVd)                                 |
|  10  |      阿若       |                                [Codepen](https://codepen.io/skar5268/pen/xxeeoop)                                 |
|  11  |     Lauren      |                          [Codepen](https://codepen.io/Lauren8/pen/GRLLbVL?editors=1112)                           |
|  12  |    LiLiLiLi     |                        [Codepen](https://codepen.io/jungang0414/pen/zYXXgrp?editors=0012)                         |
|  13  |       han       |                        [Codepen](https://codepen.io/iamHanCheng/pen/wvZZbLx?editors=1111)                         |
|  14  |      Emma       |                                 [Codepen](https://codepen.io/huang_L/pen/KKYYOmW)                                 |
|  15  |      MDFk       |                          [Codepen](https://codepen.io/aqcrrhwb/pen/ZEZZNVd?editors=0012)                          |
|  16  |  brucelee0629   |                    [Codepen](https://codepen.io/xxhdklwi-the-decoder/pen/abxxeYa?editors=1011)                    |
|  17  |      Ariel      |                         [Codepen](https://codepen.io/ariel0510/pen/vYMMobE?editors=0010)                          |
|  18  |       Kai       |                      [Codepen](https://codepen.io/imkaikai9997874/pen/RwOOXom?editors=0011)                       |
|  19  |      Yuwen      |                     [Codepen](https://codepen.io/Yuwen-the-reactor/pen/oNOOKdO?editors=0012)                      |
|  20  |    Chia Pin     |                                [Codepen](https://codepen.io/joker-cat/pen/rNbgBMP)                                |
|  21  |      白白       |                           [Codepen](https://codepen.io/YuBai/pen/VwNOZav?editors=0011)                            |
|  22  |      Sammy      |                     [Codepen](https://codepen.io/fsczdlla-the-bold/pen/xxeevpy?editors=1111)                      |
|  23  |     Chingya     |                               [Codepen](https://codepen.io/chingya1214/pen/eYooqdG)                               |
|  24  |     yicheng     |                        [Codepen](https://codepen.io/YiChengCHANG/pen/ZEZNzxP?editors=1111)                        |
|  25  |    yunyouob     |                   [Codepen](https://codepen.io/ozkkvlsu-the-animator/pen/zYXQOJO?editors=1111)                    |
|  26  |      紫珩       |                               [Codepen](https://codepen.io/tzhengliin/pen/OJGYJLE)                                |
|  27  |    Joey一針     |                                [Codepen](https://codepen.io/joeychou/pen/oNORvQz)                                 |
|  28  |     Joy1712     |                          [Codepen](https://codepen.io/Joy1712/pen/BaEEmQM?editors=1011)                           |
|  29  |     WEIWEI      |                                [Codepen](https://codepen.io/weiwei93/pen/WNWBNQP)                                 |
|  30  |    Tanyaaaa     |                               [Codepen](https://codepen.io/tanya77777/pen/yLrWBmW)                                |
|  31  |       Ana       |                           [Codepen](https://codepen.io/Ana-Wu/pen/ExJzxmN?editors=1112)                           |
|  32  |    mike_2049    |                                [Codepen](https://codepen.io/mike2049/pen/BaEEgpG)                                 |
|  33  |      Peggy      |                                [Codepen](https://codepen.io/peggy0419/pen/mdggNXd)                                |
|  34  |   CrystalLala   |                               [Codepen](https://codepen.io/crystallala/pen/ExJJBbZ)                               |
|  35  |     Mionne      |                                [Codepen](https://codepen.io/neohyntw/pen/mdgYybo)                                 |
|  36  |      Casey      |                           [Codepen](https://codepen.io/Caseyyyyyyyyyyyyyy/pen/oNORNJq)                            |
|  37  |       tim       |                   [Codepen](https://codepen.io/jskrtivy-the-animator/pen/xxeNbbY?editors=1111)                    |
|  38  |       Rio       |                           [CodePen](https://codepen.io/wei_wu/pen/ExJzaPo?editors=1010)                           |
|  39  |     Winnie      |                     [Codepen](https://codepen.io/codepen-io-winnie/pen/bGJJXpV?editors=1111)                      |
|  40  |     yuling      |                                [Codepen](https://codepen.io/igzdflpu/pen/mdggNBb)                                 |
|  41  |      小趴       |                                [Codepen](https://codepen.io/papa2415/pen/Pogvorv)                                 |
|  42  |      boin       |                                 [Codepen](https://codepen.io/boinji/pen/bGJydVr)                                  |
|  43  |     Elva Su     |                          [Codepen](https://codepen.io/evensu_/pen/vYMwOON?editors=0011)                           |
|  44  |    sylviabuy    |                         [Codepen](https://codepen.io/sylviabela/pen/gOyJpwg?editors=1111)                         |
|  45  |      Shiny      |                                [Codepen](https://codepen.io/shinychen/pen/ZEZNYbK)                                |
|  46  |    damon0323    |                          [Codepen](https://codepen.io/swk9eny2/pen/WNWBbYj?editors=0011)                          |
|  47  |       Six       |                          [Codepen](https://codepen.io/Max-kuo/pen/XWQwbGW?editors=0011)                           |
|  48  |  liugod3824🔥   |                   [Codepen](https://codepen.io/kjssvtkr-the-animator/pen/eYoaNwO?editors=0011)✔                   |
|  49  |      Haley      |                          [Codepen](https://codepen.io/wsx3690/pen/abxrOXO?editors=0012)                           |
|  50  |       宇        |                              [Codepen](https://codepen.io/jian-yu-chen/pen/BaEeNPY)                               |
|  51  |      Mika       |                          [Codepen](https://codepen.io/shumtzhz-the-encoder/pen/yLrWYma)                           |
|  52  |    Daisy Li     |                    [Codepen](https://codepen.io/lidairong-gmail-com/pen/qBwGEoL?editors=0012)                     |
|  53  |      Ellie      |                        [Codepen](https://codepen.io/Ellie-Chiang/pen/MWRdKpo?editors=0011)                        |
|  54  |    Amy(咂摳)    |                    [Codepen](https://codepen.io/nnxucgmc-the-builder/pen/rNbgxjY?editors=0011)                    |
|  55  |     suandme     |                       [Codepen](https://codepen.io/su-su-the-sans/pen/wvZbGxy?editors=1111)                       |
|  56  |      薛逢       |                          [Codepen](https://codepen.io/vogqyrrj-the-selector/pen/gOyJPqP)                          |
|  57  |      小米       |                        [Codepen](https://codepen.io/hlgudwue-the-typescripter/pen/qBwGZrB)                        |
|  58  |     sweewei     |                        [Codepen](https://codepen.io/sweewei-Law/pen/PogvzZa?editors=1112)                         |
|  59  |      JUN_       |                           [Codepen](https://codepen.io/Jun-L/pen/zYXQBpo?editors=1011)                            |
|  60  |      Shawn      |                [Codepen](https://codepen.io/Zhang-shawn-the-typescripter/pen/dyLEXqm?editors=1111)                |
|  61  |      閆安       |                         [Codepen](https://codepen.io/yanann7777/pen/rNbgLaa?editors=0011)                         |
|  62  |       MY        |                          [Codepen](https://codepen.io/ahmomoz/pen/MWRdjgb?editors=1011)                           |
|  63  |      Eden       |                                 [Codepen](https://codepen.io/iseden/pen/RwOmRXE)                                  |
|  64  |      黛Dye      |                          [Codepen](https://codepen.io/Dye_Note/pen/wvZZoWp?editors=1011)                          |
|  65  |    快樂小豬     |                          [Codepen](https://codepen.io/rtjowfyf-the-lessful/pen/OJGYyOr)                           |
|  66  |      黛西       |                        [Codepen](https://codepen.io/ChiashengLin/pen/XWQwmeK?editors=1112)                        |
|  67  | Guan(yangguan.) |                         [Codepen](https://codepen.io/Yang-guan/pen/WNWBGmj?editors=1111)                          |
|  68  |      Ching      |                               [CodePen](https://codepen.io/huangching/pen/VwNOmaL)                                |
|  69  |    leo.chang    |                                [Codepen](https://codepen.io/s16777216/pen/OJGYbMW)                                |
|  70  |   hongru-LyNn   |                                 [Codepen](https://codepen.io/LyNnYWu/pen/ExJzgde)                                 |
|  71  |   Tough life    |                               [Codepen](https://codepen.io/hakuei0115/pen/oNORYwX)                                |
|  72  |    ss585801     |                          [Codepen](https://codepen.io/ss585801/pen/GRLaNEr?editors=0011)                          |
|  73  |    yu.t_liu     |                         [Codepen](https://codepen.io/YuT200053/pen/VwNOmgP?editors=1011)                          |
|  74  |     Antonio     |                          [Codepen](https://codepen.io/gwhvusel-the-builder/pen/OJGYWLZ)                           |
|  75  |       CC        |                    [Codepen](https://codepen.io/gwhvusel-the-builder/pen/RwOmKJB?editors=1111)                    |
|  76  |     s870012     |                    [Codepen](https://codepen.io/idzrvbnl-the-bashful/pen/rNbgjQW?editors=0011)                    |
|  77  |     Camila      |                                [Codepen](https://codepen.io/camilalo/pen/qBwGrdY)                                 |
|  78  |     Zander      |                              [Codepen](https://codepen.io/chuangmaster/pen/KKYLmKZ)                               |
|  79  |      Jiahe      |                        [Codepen](https://codepen.io/Andywang-95/pen/dyLEWjX?editors=0012)                         |
|  80  |      Maca       |                           [CodePen](https://codepen.io/uimaca/pen/vYMwedX?editors=0010)                           |
|  81  |      樂樂       |                           [Codepen](https://codepen.io/Wpypy/pen/rNbgGZg?editors=1111)                            |
|  82  |     Andy_12     |                           [Codepen](https://codepen.io/lifann/pen/ZEZNavb?editors=0011)                           |
|  83  |  Frank Chiang   |                        [Codepen](https://codepen.io/frankchiang/pen/yLrWPWO?editors=1111)                         |
|  84  |   jami_37521    |                                [Codepen](https://codepen.io/jamiHexo/pen/GRLaymb)                                 |
|  85  |   禮央 (れお)   |                                  [CodePen](https://codepen.io/J-Y-P/pen/qBwGpGv)                                  |
|  86  |      KUN.       |                         [Codepen](https://codepen.io/barry91205/pen/vYMwdJG?editors=1111)                         |
|  87  |    kebukeyi     |                          [Codepen](https://codepen.io/kebukeyi/pen/GRLaQPE?editors=1111)                          |
|  88  |      Toung      |                           [Codepen](https://codepen.io/Toung/pen/VwNOrrr?editors=0111)                            |
|  89  |       QOO       |                          [Codepen](https://codepen.io/QOOQOOQ/pen/poBmadZ?editors=0011)                           |
|  90  |    macihuang    |                                [Codepen](https://codepen.io/macy1215/pen/yLrWvWw)                                 |
|  91  |   jcode0x378    |                       [Codepen](https://codepen.io/jeffreylin1990/pen/eYoaMMJ?editors=0012)                       |
|  92  |   ninii傳教士   |                          [Codepen](https://codepen.io/niiniiii/pen/zYXQWJo?editors=0011)                          |
|  93  |       JY        |                         [Codepen](https://codepen.io/jylee0805/pen/oNORMjB?editors=1011)                          |
|  94  |    Ed Huang     |                          [Codepen](https://codepen.io/yide1986/pen/wvZbQdY?editors=1012)                          |
|  95  |      Kasie      |                           [Codepen](https://codepen.io/KasieL/pen/ExJzBzW?editors=0011)                           |
|  96  |    easonpan     |                              [Codepen](https://codepen.io/easonpan0904/pen/dyLByMN)                               |
|  97  |    婉玲Dacy     |                   [Codepen](https://codepen.io/xxaynqoq-the-animator/pen/KKYjwZg?editors=0012)                    |
|  98  |  kevinwen2014   |                           [Codepen](https://codepen.io/wenwoo/pen/QWPXbRB?editors=1111)                           |
|  99  |      kawa       |                          [Codepen](https://codepen.io/z83xji6/pen/yLrdNGR?editors=1011)                           |
| 100  |   emmazhang.    |                                [Codepen](https://codepen.io/zhangemma/pen/LYvKpyx)                                |
| 101  |    isongzhe     |                          [Codepen](https://codepen.io/Isongzhe/pen/xxeoZQJ?editors=1010)                          |
| 102  |    aoya9155     |                          [Codepen](https://codepen.io/aoya2139/pen/bGJPEZe?editors=0011)                          |
| 103  |       嵬        |                           [Codepen](https://codepen.io/Obivld/pen/poBXyzr?editors=1111)                           |
| 104  |       Ran       |                  [Codepen](https://codepen.io/Ran-Ran-the-typescripter/pen/ExJBwbr?editors=0011)                  |
| 105  |      達達       |                         [Codepen](https://codepen.io/Adam-Tsai/pen/dyLBwzK?editors=1111)                          |
| 106  |      oldan      |                               [Codepen](https://codepen.io/Enix-Chien-/pen/QWPXobx)                               |
| 107  |      oyll       |                              [Codepen](https://codepen.io/dizzydog-rgb/pen/ExJBMpP)                               |
| 108  |   weeixunzht    | [Codepen](https://codepen.io/CalebZhang/pen/RwOmxod?editors=1001)[Codepen](https://codepen.io/deamru/pen/OJGKNyV) |
| 109  |     杰_jie      |                          [Codepen](https://codepen.io/hmj8805/pen/QWPeEbr?editors=1111)                           |
| 110  |    james867.    |                           [Codepen](https://codepen.io/JCT34/pen/zYXgNpY?editors=1012)                            |
| 111  |   PoWei#8484    |                         [Codepen](https://codepen.io/Po-Wei-Lai/pen/gOyVvwO?editors=1112)                         |
| 112  |     Eileen      |                                [Codepen](https://codepen.io/Eileen-io/pen/GRLVxKj)                                |
| 113  |   discat3119    |                                [Codepan](https://codepen.io/dizzysoup/pen/zYXgprB)                                |
| 114  |  asabulu_von_f  |                          [Codepan](https://codepen.io/asabulu/pen/jORgzWx?editors=0011)                           |
| 115  |     wan_ju      |                          [Codepan](https://codepen.io/Laura21/pen/oNOKqRZ?editors=1111)                           |
| 116  |      Stone      |                         [Codepan](https://codepen.io/stonetein/pen/BaEXVJz?editors=0011)                          |
| 117  |      Sonia      |                           [Codepen](https://codepen.io/YUJOU/pen/VwNoJwY?editors=1111)                            |
| 118  |      知夜       |                        [Codepen](https://codepen.io/XiaoXiaTian2/pen/YzMmmMJ?editors=1111)                        |
| 119  |    cindyLo     |                               [Codepen](https://codepen.io/cindy820218/pen/BaeBKZN)                               |
| 120  |     yo0x0oy     |                              [Codepen](https://codepen.io/Dayton-Hsieh/pen/yLWBqeK)                               |
| 121  |   jerry_66983   |                          [Codepen](https://codepen.io/Barry-C/pen/ZENzjeM?editors=0110)                           |
| 122  |    hsiu8767     |                                [Codepen](https://codepen.io/hsiu8767/pen/bGybLPg)                                 |
| 123  |     .zack_p     |                        [Codepen](https://codepen.io/Designer-PH/pen/jOoObWL?editors=0012)                         |
| 124  |   l.shua_228    |                          [Codepen](https://codepen.io/Shan-Hua-Lin-LIN-HUA/pen/NWVWGVM)                           |
| 125  |     Jainee      |                               [Codepen](https://codepen.io/Jainee0110/pen/JjqjKej)                                |
| 126  |      艾洛       |                          [Codepen](https://codepen.io/Ironance/pen/ExzamoX?editors=0012)                          |
| 127  |    hao jing     |                                  [Codepen](https://codepen.io/hjxu/pen/KKLKJqd)                                   |
| 128 | 搗蛋鬼別搗蛋 |                                                                                         [Codepen](https://codepen.io/yaling0616/pen/dyEoBBE?editors=1111) |
| 130 | 邵 |[Codepen](https://codepen.io/ukscrlno-the-typescripter/pen/LYoNybY?editors=0011)|
| 131 | Shen |[Codepen](https://codepen.io/yan-Shen-the-decoder/pen/WNBwBrO)|
| 132 | n913239 | [Codepen](https://codepen.io/n913239/pen/ExzZzLb?editors=1010) |
| 133 | maruko1105 | [Codepen](https://codepen.io/marukox1105/pen/YzbZjLK?editors=1011) |
| 134 | LYC | [Codepen](https://codepen.io/LY-C/pen/gOyJYbw?editors=1111) |
| 135 | ChrisLin | [CodePen](https://codepen.io/vllzfzco-the-reactor/pen/yLWvyxO?editors=1111) |
| 136 | Lang | [codepen](https://codepen.io/Hsiflow-Lang/pen/OJePpVr?editors=0012)|

<!-- | 000 | username | [Codepen]() | -->
