---
# System prepended metadata

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

---

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

# 🏅 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   |      冬天#5215       |              [Codepen](https://codepen.io/winter_/pen/OJBxmjN)              |
|  2   |     chichi#1534      |            [Codepen](https://codepen.io/chichihuang/pen/poxWPVp)            |
|  3   |      Judy #7874      |       [Codepen](https://codepen.io/hsiaohan/pen/QWZqvXQ?editors=1011)       |
|  4   |     Eden.C#9359      |              [codepen](https://codepen.io/iseden/pen/OJBxgPg)               |
|  5   |     Berlin#7338      |       [codepen](https://codepen.io/3qberlin/pen/RweLgaK?editors=0110)       |
|  6   |      DeLi#8324       |           [codepen](https://codepen.io/delichaomoon/pen/OJBxgZv)            |
|  7   |     Quantum#6093     |           [codepen](https://codepen.io/Min-Hao-Hung/pen/MWPEoqM)            |
|  8   |     Snadra#1987      |             [codepen](https://codepen.io/mlqmhltg/pen/LYgzLMx)              |
|  9   |      LeeRu#1771      |      [codepen](https://codepen.io/IMGameKing/pen/BaqwZEO?editors=1000)      |
|  10  |       kai#1098       |               [codepen](https://codepen.io/ahkai/pen/qBJPjGr)               |
|  11  |     Rochel#4754      |    [codepen](https://codepen.io/rochelwang1205/pen/NWOageE?editors=0010)    |
|  12  |      Lychee KK       |       [codepen](https://codepen.io/kakakala/pen/BaqwRxQ?editors=1112)       |
|  13  |     銀光菇#1692      |           [codepen](https://codepen.io/genesynthesis/pen/bGmoWLq)           |
|  14  |    Izumi 泉#9691     |             [codepen](https://codepen.io/kouta-f2e/pen/oNaGeGq)             |
|  15  |   Kulimusoda#2785    |     [codepen](https://codepen.io/yuch3n_chen/pen/bGmorxG?editors=0011)      |
|  16  | charlottelee849#0366 |       [codepen](https://codepen.io/char849/pen/dygVzgq?editors=0012)        |
|  17  |      duck#3310       |             [codepen](https://codepen.io/papy0715/pen/dygVzLg)              |
|  18  |     yichih#6223      |      [codepen](https://codepen.io/Ingridchen/pen/OJBxgMj?editors=1011)      |
|  19  | K（アギルダー）#0386 |            [codepen](https://codepen.io/klay376014/pen/BaqwwNN)             |
|  20  |      阿榮#8277       |            [CodePen](https://codepen.io/codeitaday/pen/WNaZZNx)             |
|  21  |    CMLB0212#8960     |     [codepen](https://codepen.io/Chungmin0212/pen/qBJPXey?editors=0011)     |
|  22  |     ChaosTu#9311     |        [codepen](https://codepen.io/torotu/pen/oNaGGxm?editors=0012)        |
|  23  |    peihsuan#6315     |            [codepen](https://codepen.io/peihsuanlai/pen/NWOavqm)            |
|  24  |  bonnieli1414#4906   |     [codepen](https://codepen.io/bonnieli1414/pen/rNqGGzv?editors=0012)     |
|  25  |      啊和#4729       |        [codepen](https://codepen.io/shnny/pen/mdzBBpJ?editors=0011)         |
|  26  |     Pigsue#5981      |       [codepen](https://codepen.io/weixiii/pen/jOeGGoZ?editors=1111)        |
|  27  |      鉦勝#8333       |      [codepen](https://codepen.io/atckmax823/pen/oNaGGON?editors=0011)      |
|  28  |    Jacky7035#9423    |             [codepen](https://codepen.io/adens123/pen/Baqwmzm)              |
|  29  |      SKey#9905       |            [codepen](https://codepen.io/Dale-Chien/pen/PoyJOqm)             |
|  30  |      penny#6214      |      [codepen](https://codepen.io/penny8989/pen/BaqwmOV?editors=0011)       |
|  31  |    satarkuo#5736     |       [codepen](https://codepen.io/SatarKuo/pen/wvYrPxx?editors=1111)       |
|  32  |       Uli#1946       |              [codepen](https://codepen.io/uli1313/pen/PoyJOdR)              |
|  33  |    andychiou#4830    |           [codepen](https://codepen.io/andychiou1113/pen/bGmoYOm)           |
|  34  |      vvay#4113       |       [codepen](https://codepen.io/pellmssx-the-sasster/pen/oNaGwJZ)        |
|  35  |       翔.#0859       |     [codepen](https://codepen.io/energy95272z/pen/xxyXpxg?editors=0011)     |
|  36  |    135144365#3152    |       [codepen](https://codepen.io/Heng902/pen/ExdwbQa?editors=1111)        |
|  37  |     Hanana#9025      |             [codepen](https://codepen.io/hananalin/pen/oNaGpjG)             |
|  38  |     黑白兔#0684      |             [codepen](https://codepen.io/johnny329/pen/poxWWbw)             |
|  39  |     jia yu#8896      | [codepen](https://codepen.io/fjqxaznl-the-reactor/pen/zYmEROp?editors=0010) |
|  40  |      yoyo#1003       |                  [codepen](https://codepen.io/pen/JjmrMgZ)                  |
|  41  |      Welly#3964      |              [codepen](https://codepen.io/welly09/pen/GRYMQeq)              |
|  42  |    alexmav04#5048    |             [codepen](https://codepen.io/alexmav04/pen/WNaZzNd)             |
|  43  |    肉個阿倫#7172     |             [Codepen](https://codepen.io/i9574385/pen/poxWLbO)              |
|  44  |      Eero#1147       |      [Codepen](https://codepen.io/Eero-Chiao/pen/eYPGMom?editors=1011)      |
|  45  |   Jerry456789#9029   |       [Codepen](https://codepen.io/aria198a/pen/oNaGdBo?editors=0010)       |
|  46  |    liam9930#4129     | [Codepen](https://codepen.io/jgnjfvvt-the-lessful/pen/jOeGxdq?editors=0011) |
|  47  |     jackwu#4437      |           [Codepen](https://codepen.io/jackwu1588003/pen/qBJPYMo)           |
|  48  |     jelly77#2088     |     [Codepen](https://codepen.io/Ming-chiang/pen/zYmEjgp?editors=0011)      |
|  49  |    司機叔叔#2463     |       [Codepen](https://codepen.io/bigv5566/pen/abRLKmj?editors=0010)       |
|  50  |      泊岸#3466       |     [Codepen](https://codepen.io/qoq77416416/pen/yLRzEpP?editors=1011)      |
|  51  |     Evaxof#1266      |        [Codepen](https://codepen.io/evaxof/pen/LYgzBeN?editors=0010)        |
|  52  |     jimhop#6510      |     [Codepen](https://codepen.io/jimsansssss/pen/qBJPypb?editors=1111)      |
|  53  |      狸貓#5863       |      [Codepen](https://codepen.io/tanuki320/pen/LYgzJNj?editors=0011)       |
|  54  |   clairechen#3498    |            [Codepen](https://codepen.io/yi-wen-chen/pen/RweLYbQ)            |
|  55  |       cbs#9007       |              [Codepen](https://codepen.io/wasdjk/pen/ZEqXoEY)               |
|  56  |      Akira#9996      |            [Codepen](https://codepen.io/Akira-Chen/pen/MWPEqPb)             |
|  57  |     wiimax#4564      |             [Codepen](https://codepen.io/willismax/pen/wvYrENw)             |
|  58  |   N0c7iluc3n7#4390   |          [Codepen](https://codepen.io/huang-yu-cheng/pen/mdzBGLQ)           |
|  59  |      Janet#5784      |      [Codepen](https://codepen.io/janetlinnn/pen/mdzBzVZ?editors=1111)      |
|  60  |    David0799#4415    |             [Codepen](https://codepen.io/David0799/pen/PoyJybw)             |
|  61  |     ray0304#2070     |              [Codepen](https://codepen.io/Ray0304/pen/poxWxvR)              |
|  62  |   しあわせね#0036    |  [Codepen](https://codepen.io/Front-end-engineer/pen/NWOaOXd?editors=0012)  |
|  63  |      居米#6044       |     [Codepen](https://codepen.io/AndyLiu0427/pen/poxWxxp?editors=0010)      |
|  64  |      兔子#6746       |    [Codepen](https://codepen.io/CarrotDetector/pen/Baqwqvp?editors=0010)    |
|  65  |    HsuanTang#1349    |             [Codepen](https://codepen.io/HsuanTang/pen/VwEMVLv)             |
|  66  | Jennifer Chuang#3937 |        [Codepen](https://codepen.io/yujhen/pen/LYgzXZV?editors=1111)        |
|  67  |      Dizzi#4952      |            [Codepen](https://codepen.io/dizzi_chang/pen/xxyXyvN)            |
|  68  | wayne#9661 |        [Codepen](https://codepen.io/waynechen77/pen/poxWQOY?editors=1111 )        |
|  69  | 辣椒#1002 |[Codepen](https://codepen.io/chilichen118/pen/wvYrQPm) |
|  70  | Yuu#5361 |[Codepen](https://codepen.io/alycehwy/pen/gOBGZKq) |
|  71  | 薇拉#8110 |[Codepen](https://codepen.io/michellecc0522/pen/BaqwvGX?editors=1111) |
|72|提姆#9581|[Codepen](https://codepen.io/timouo/pen/rNqGobw)|
|73|Bruce-Lee#0629|[Codepen](https://codepen.io/xxhdklwi-the-decoder/pen/qBJPgYv?editors=0011)|
|74|JasonChang#7847|[Codepen](https://codepen.io/jsonChangJava/pen/NWOaQwZ)|
|75|Ying Ying Liu #0836|[Codepen](https://codepen.io/yingyliu/pen/yLRzmZJ?editors=0011)|
| 76 | Tami#6742 | [CodePen](https://codepen.io/wqsdqbjn-the-vuer/pen/NWOwKNx) |
|77|snow#0255|[Codepen](https://codepen.io/snow21723/pen/LYgzjOQ)|
| 78 | grayyyy#1014 | [CodePen](https://codepen.io/jhye0222/pen/OJBOJNm) |
| 79 | JimmyHuang#5281 | [CodePen](https://codepen.io/JimmyHuang369/pen/JjmOjzK) |
|80|PayRoom#8328|[CodePen](https://codepen.io/water38198/pen/OJBOPgr)
|81|汪汪#4486|[Codepen](https://codepen.io/hunwooooof/pen/yLRzPoZ)|
|82|羽毛#5463|[Codepen](https://codepen.io/KYuFeather/pen/RwejPom)|
|83|魚翅#3100|[Codepen](https://codepen.io/Fukahire/pen/VwErLXJ)|
|84|冷曄#9378|[Codepen](https://codepen.io/HgHale/pen/xxyPwKe?editors=0011)|
|85|長方形#9612|[Codepen](https://codepen.io/imjjw/pen/vYVWEGp)|
|86|雲漢#5319|[Codepen](https://codepen.io/keon981/pen/LYgOpaR?editors=0011)|
|87|JhouHank#8132|[Codepen](https://codepen.io/JhouHank/pen/poxdjxG)|
|88|JimWang#6134|[Codepen](https://codepen.io/Jim-Wang-the-selector/pen/LYgOGpW?editors=1111)|
|89|LeoSong#9861|[Codepen](https://codepen.io/leosong1116/pen/abRVdzZ?editors=1010)|
|90|肉魚#2149|[Codepen](https://codepen.io/zoechen13/pen/bGmYEbm)|
| 91 | endau66#2102 | [CodePen](https://codepen.io/endau66/pen/BaqmamJ)|
|92|東東#5015| [CodePen](https://codepen.io/wearymask/pen/rNqGGBY)|
|93|Jaredlee#5887| [CodePen](https://codepen.io/jared-lee/pen/GRYOqGv?editors=0011)|
|94|homer#1525| [CodePen](https://codepen.io/Buckhorn/pen/rNqYaaV)|
|95|jun777#2468| [CodePen](https://codepen.io/js18151102/pen/wvYPgQj?editors=0011)|
|96|大昌#6691| [CodePen](https://codepen.io/jswei014/pen/poxdKzy)|
|97|君Jyun#0147|[codepen](https://codepen.io/JyunCodepen/pen/Baqmjbg?editors=1011)|
|98|呵哈#6479|[codepen](https://codepen.io/CHYETI/pen/xxyPQxM)|
|99|貢波波夫#3056|[codepen](https://codepen.io/CHYETI/pen/xxyPQxM)|
|100|YHT#1696|[codepen](https://codepen.io/YHT31/pen/xxyPyza)|
|101|wendyli#2155|[codepen](https://codepen.io/rockayumitw/pen/Baqmegz?editors=0012)|
|102|小明#4408|[codepen](https://codepen.io/ujlylmbv-the-lessful/pen/eYPeqxz)|
|103|PoWei#8484|[codepen](https://codepen.io/harrison-wei-lai/pen/wvYpvEP?editors=0010)
|104|andrew#0404|[codepen](https://codepen.io/Loonng/pen/WNaXEvL)
|105|Yui1024#8275|[codepen](https://codepen.io/Yuiyuichou/pen/YzJYGxr)
|106|變羊魔法#6372|[codepen](https://codepen.io/cssf998811/pen/rNqpMya)
|107|MitA#7407|[codepen](https://codepen.io/qaz15996398/pen/yLRpgPE)
|108|鄭舜仁#6606|[codepen](https://codepen.io/randomno/pen/bGmagMo)
|109|Yui1024#8275|[codepen](https://codepen.io/Yuiyuichou/pen/LYgejjx)
|110|edie599916#7112|[codepen](https://codepen.io/Chen-CiCi/pen/qBJpVXz?editors=0010)
|111|Pinkstar#4993|[codepen](https://codepen.io/gabriel09772/pen/RwexxBQ)
|112|柚子#3958|[codepen](https://codepen.io/as6625998/pen/QWZamyv?editors=0011)
|113|lililala#4020|[codepen](https://codepen.io/gnituyccc/pen/MWPrGLY)
|114|安安#4782|[codepen](https://codepen.io/ratsai/pen/xxypzJj?editors=1111)
|115|Jarvis莊#8679|[codepen](https://codepen.io/jason-hsuan/pen/yLRpGoW?editors=0011)
|116|ABOOS#6276|[codepen](https://codepen.io/guhungyin/pen/LYgeazK?editors=0012)|
|117|Zhong#8917|[codepen](https://codepen.io/klfjrlod-the-sasster/pen/MWPrNXN)|
|118|郭芙蘭#6374|[codepen](https://codepen.io/flora_Kuo/pen/yLRvNXO?editors=1011)|
|119|Ling#2765|[codepen](https://codepen.io/linglingsu/pen/ExdQWJy)|
|120|Winnie#2737|[codepen](https://codepen.io/WinnieHuang/pen/rNqJmeL?editors=1111)|
|121|betty#0693|[codepen](https://codepen.io/betty-hu/pen/WNaMXew?editors=0012)|
|122|啊真真#8940|[codepen](https://codepen.io/fctamuvf-the-vuer/pen/xxyYjBO)
|123|Alice Su#4613|[codepen](https://codepen.io/alice0401/pen/jOeZeMg)
|124|ruby0316#3380|[codepen](https://codepen.io/rena6211zera/pen/qBJxgRX)
|125|一瑋#8459|[CodePen](https://codepen.io/zerosula/pen/xxyWwbW)|
|126|leo.yujie#8280|[CodePen](https://codepen.io/peihsin-the-scripter/pen/wvYmMPp)|
|127|喬喬#2824|[CodePen](https://codepen.io/joanne-wei/pen/ExdENRm)|
|128|ssshane#0673|[CodePen](https://codepen.io/sam6091260/pen/LYgdxao?editors=1111)|
|129|Neal#7428|[CodePen](https://codepen.io/thinkingsmonkey/pen/rNqdWoj?editors=0011)|
|130|不要迷戀媽的奶#0295|[CodePen](https://codepen.io/kewdjbwp-the-typescripter/pen/abREXVV)|
|131|chicken38#1539|[CodePen](https://codepen.io/chickenag/pen/wvYmrBE)|
|132|勁霖#1602|[CodePen](https://codepen.io/nickwu1229/pen/PoyQLLG)|
|133|Mylène#2481|[CodePen](https://codepen.io/hamajibashi/pen/zYmjoBx)|
|134|Yvonne#2721|[CodePen](https://codepen.io/Evonne/pen/poxVyZz?editors=0010)|
|135|Ataraxia#9977|[CodePen](https://codepen.io/ataraxia8888/pen/qBJPWag)|
|136|townyuan#2653|[CodePen](https://codepen.io/townyuan/pen/PoyaNNJ)|
|137|Elena Lin #3392|[CodePen](https://codepen.io/elenalin119/pen/BaqVLbZ?editors=1111)|
|138|Callmelulu#2290|[CodePen](https://codepen.io/callmelulu/pen/vYVrgxa)|
|138|FanJJ#8061|[CodePen](https://codepen.io/yfchenn/pen/MWPXOXb?editors=0012)|
|139|Sabrina#3073|[CodePen](https://codepen.io/SabrinaGuo/pen/qBJyVVj?editors=0011)|
|140|ABow_Chen#0800|[CodePen](https://codepen.io/fred39392001/pen/wvYxmdR)|
|141| Jenny真#7532 | [CodePen](https://codepen.io/wei-chen-wu/pen/qBJyKLb?editors=1111) |
|142| SharonLin#0915 | [CodePen](https://codepen.io/sharonlin1001/pen/XWxBOeG) |
|143| Hsiu#876 | [CodePen](https://codepen.io/hsiu8767/pen/MWPXNRG?editors=0010) |
|144| Lainie#1931 | [CodePen](https://codepen.io/Lainie88/pen/wvYERoL?editors=1010) |
|143| alan0305#2423 | [CodePen](https://codepen.io/alan0305/pen/qBJMzyR) |
|144| Billy_Ti#9716 | [CodePen](https://codepen.io/Ti-Show/pen/GRYxLpZ?editors=0012) |
|145| remk97#2022 | [CodePen](https://codepen.io/remk97/pen/ExddPvv) |
|145| 科科#5463 | [CodePen](https://codepen.io/ilove941120/pen/WNagbdw?editors=1112) |
|146| 小魚#8614 | [CodePen](https://codepen.io/gizelliang/pen/NWOOwQo) |
|147| cherylxie#5898 | [CodePen](https://codepen.io/cherylxie912/pen/poxQoBB?editors=0012) |
|148| Tim123#8361 | [CodePen](https://codepen.io/Wangtim4/pen/vYVQgQm?editors=0012) |
|149| FiReBrO#0557 | [CodePen](https://codepen.io/firebro42/pen/MWPzGJW) |
|150| Ann Chou#0146 | [CodePen](https://codepen.io/annchou_illu/pen/WNaLpRY) |
|151| hello77tw#5984| [CodePen](https://codepen.io/luyoyo/pen/XWxogbB?editors=0111) |
|152| alll6z#9204| [CodePen](https://codepen.io/A6Z/pen/dygwRmo) |
|153| 浪裡小白龍#6860| [CodePen](https://codepen.io/art-jg/pen/GRYPWxd?editors=0011) |
|154| Shiloh#8447| [CodePen](https://codepen.io/pkezwtnq-the-encoder/pen/Poygpdj?editors=0011) |
| 155 | Kaya#8857 | [Codepen](https://codepen.io/laron9486/pen/KKrwpMz) |
| 156 | Tina02#2691 | [Codepen](https://codepen.io/chjitlox-the-bashful/pen/zYMNJpo) |
| 157 | hoyiiiii | [Codepen](https://codepen.io/hoyii/pen/bGXOWKd?editors=0012) |