---
# System prepended metadata

title: "\U0001F3C5 5/6(五) 每日 JS 刷題任務 - 比較與邏輯運算子"
tags: [公益程式體驗營 - 2022]

---

---
tags: 公益程式體驗營 - 2022
---

# 🏅 5/6(五) 每日 JS 刷題任務 - 比較與邏輯運算子
## 提示
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)

<!-- 解答：  -->


回報區
---

<!-- 0. Bingbingboom（回報範例，請使用註解回報）
答案：（可直接撰寫答案）
Codepen：https://codepen.io/Bingbingboom/pen/jOBZVWq
-->


<!-- 1. 洧杰
答案：（可直接撰寫答案）
Codepen：https://codepen.io/hexschool/pen/wvyvQqZ?editors=0011
-->


<!-- 2. Bruno Yu
答案：（可直接撰寫答案）
Codepen：https://codepen.io/bruno-yu/pen/poajwQm?editors=0011
-->

<!-- 3. Lemon
答案：（可直接撰寫答案）
Codepen：https://codepen.io/shumhoyin/pen/QWQjMLP
-->


<!-- 4. yunyun
答案：（可直接撰寫答案）
Codepen：https://codepen.io/yun_yunni/pen/GRQpvgG
-->

<!-- 5. su#7798
codepen: https://codepen.io/wc-su/pen/abqvyzB
-->

<!-- 6. Jason Chen
答案：（可直接撰寫答案）
Codepen：https://codepen.io/jason60810/pen/MWQavJa
-->

<!-- 7. Josh Chen#4552
答案：（可直接撰寫答案）
Codepen：https://codepen.io/hiphop825/pen/VwQvzrd?editors=0010
-->

<!-- 8. Chi
 Codepen: https://codepen.io/YoChi84/pen/poajrpg
-->

<!-- 9. pipi
 Codepen: https://codepen.io/pipiyy13/pen/GRQpvQP
-->

<!-- 10. shijia
 Codepen：https://codepen.io/shijia22/pen/JjpYyZM?editors=0011 -->

<!-- 11. Aaron 
Codepen : https://codepen.io/narrowd4c/pen/GRQJoJP?editors=1011
-->

<!-- 12. Art 
Codepen : https://codepen.io/ss97202tw/pen/NWyGvoq?editors=0011
-->

<!-- 13. Joyce#3790
 codepen: https://codepen.io/joycehuang/pen/eYVpGzy?editors=0011
-->

<!-- 14. yuyu#6310
 codepen: https://codepen.io/yuyu0905/pen/MWQaEyv
-->

<!-- 15. Chaco #2993
 codepen: https://codepen.io/chaco-wang/pen/LYQpzLa?editors=0011
-->

<!-- 16. Eric.S
 codepen: https://codepen.io/Eric_Shen/pen/mdXeBXJ
-->

<!-- 17. Rex_Chu
 codepen:
https://codepen.io/rex_chu/pen/YzeyrWb
-->

<!-- 18. rejennylo
https://codepen.io/reJennylo/pen/dydYVKx
-->

<!-- 19. Leo Song
codepen:
https://codepen.io/sunnylaba/pen/zYRvEPJ?editors=0010
-->

<!-- 20. hw
Codepen:
https://codepen.io/Lhwei/pen/mdXeBQV
-->

<!-- 21. SASIMI #5099
Codepen:
https://codepen.io/sashimi1327/pen/RwQWLza
-->

<!-- 22. JustinLiu
Codepen: https://codepen.io/justin0227/pen/QWQjqzO?editors=0010
-->

<!-- 23. IreneLee
 CodePen:
https://codepen.io/ntjtcxpt-the-animator/pen/ExQVbVB?editors=0012
-->

<!-- 24. CloThEs
答案：
Codepen：https://codepen.io/bogwdnxx-the-sans/pen/xxYwPxv
-->

<!-- 25. Peng
https://codepen.io/peng-027/pen/jOZbaVp?editors=0010
 -->
 
<!-- 26. 翁來
https://codepen.io/wguo8320/pen/OJQyOjz
 -->
 
<!-- 27. shujhen#7734
Codepen: https://codepen.io/shujhen/pen/xxYwPXG
-->
<!-- 28. roger chuang
codepen: https://codepen.io/rogerchuang/pen/jOZbGbV?editors=0011
-->

<!-- 29. Alphacostankion#8475
codepen: https://codepen.io/alphapolo/pen/VwQvrgW
-->

<!-- 30. 教練#6451
codepen: https://codepen.io/monkeybear721/pen/zYRvPyv
-->

<!-- 31. 隔壁小王
Codepen:
https://codepen.io/stevetanus/pen/LYQpepL
-->

<!-- 32. danny123
codepen: https://codepen.io/binlandz123/pen/abqvEZp?editors=1010
-->

<!-- 33. Wendy
答案：（可直接撰寫答案）
Codepen：https://codepen.io/wendy03/pen/YzeyYej
-->

<!-- 34. Murmurline#6969
答案：typeof();!res;&&;
Codepen：https://codepen.io/murmurline/pen/YzeyewM
-->


https://codepen.io/murmurline/pen/YzeyewM?editors=1111


<!-- 36. Noy
https://codepen.io/MochiCodingPen/pen/poajadW
-->

<!--37. Greta#0837
Codepen: https://codepen.io/gretali/pen/JjpYpdB -->

<!-- 38. andersonshen#4675
https://codepen.io/luxyenni-the-bold/pen/wvyKyZd
-->

<!-- 39. Yuhung#1391
Codepen: https://codepen.io/Yu__hung/pen/OJQyvwv?editors=0012
-->

<!-- 40. Stanley#3825
Codepen: https://codepen.io/sean_1215/pen/PoQPjRQ
-->

<!-- 41. Beanhuang
Codepen: https://codepen.io/Beanhuang/pen/LYQpmVL?editors=0011
-->

<!-- 42. Mojito#6002
 codepen: https://codepen.io/vu3xk41997/pen/qBxOYbm
-->

<!-- 43. Charlotte Lee
 codepen: https://codepen.io/bruno-yu/pen/poajwQm?editors=0011
-->

<!-- 44. 小鹿Kerwin#5730
 codepen: https://codepen.io/tkoleo84119/pen/qBxOxaQ
-->

<!-- 45. bakiii#2652
  https://codepen.io/aki168/pen/qBxOYMx-->
  
<!-- 46. Easton#3863
codepen: https://codepen.io/EastonIsCodingNow/pen/BaYoxbB
-->

<!-- 47. Tuhacrt#0008
Codepen:
https://codepen.io/Tuhacrt/pen/QWQjrPy?editors=0011
-->

<!-- 47. lyle#8123
Codepen:
https://codepen.io/tomys/pen/abqvKER
-->

<!-- 48 Patti Chiu Patti#7774
Codepen: 
https://codepen.io/peiru-qiu/pen/JjpYpeV?editors=0010
-->

<!-- 49 Raymond Lam Lam#0344
Codepen: 
https://codepen.io/manshun-lam/pen/vYdNawe
-->

<!-- 50 Xiang#5313
Codepen: 
https://codepen.io/snorlaxxu/pen/dydYqgK?editors=1010
-->

<!-- 51 Arista
Codepen: 
https://codepen.io/arista-hsieh/pen/ExQVeqo
-->

<!-- 52 Wanyu#5878
Codepen: 
https://codepen.io/syong668/pen/RwQWeam?editors=0012
-->

<!-- 53. Triple
 https://codepen.io/riku30/pen/PoQPBEO -->
 
 <!-- 54. deveryone#8090
Codepen: https://codepen.io/raycheng/pen/VwQvEKR?editors=0010
-->

 <!-- 55. 肉桂卷#0625
Codepen: 
https://codepen.io/ginnlee/pen/VwQvVXm?editors=0011
-->

 <!-- 56. Ryun Lu#3642
Codepen: 
https://codepen.io/ryanlu1125/pen/ZErbmqd?editors=0011
-->

<!-- 57. bonnieli1414#4906
Codepen: 
https://codepen.io/bonnieli1414/pen/OJQyadZ
-->

<!-- 58. Jim#8764
Codepen: 
https://codepen.io/jim255060/pen/zYRvyxq
-->

<!-- 59. 小不點#1793
Codepen: 
https://codepen.io/fwmfmgkx-the-flexboxer/pen/QWQjJoz?editors=1112
-->

<!-- 60. Chihsuan#0719
Codepen: 
https://codepen.io/chihsuanbjjh/pen/PoQPXwB?editors=0011
-->

<!-- 61. Yu An#1572
Codepen: 
https://codepen.io/yvonne840401tw/pen/QWQjJYz
-->

<!-- 62. Lina Chen
Codepen: https://codepen.io/LinaChen/pen/ExQVomW
-->

<!-- 63. Vera#5592
Codepen: https://codepen.io/skvera/pen/LYQpOQZ
-->

<!-- 64. Mylène
codepen:
https://codepen.io/hamajibashi/pen/poajqBb
-->

<!-- 65. Iris#4973
Codepen: https://codepen.io/docats/pen/xxYwmzX
-->

<!-- 66.  DoubleZ#2361
https://codepen.io/lazywyatt/pen/zYRvXdo
-->

<!-- 67.  Abel
https://codepen.io/lun_chi/pen/wvyKZrZ?editors=0011
-->

<!-- 68.  ChaoChao
https://codepen.io/EmiiilyJ/pen/QWQjPge
-->

<!-- 69.hsiuhsiu#7412
https://codepen.io/hsiuhsiu/pen/xxYZxLx?editors=0011
-->

<!-- 70. 炎炎#0777
 codepen: https://codepen.io/kimyen260/pen/OJQMJeZ?editors=0011 -->
 
<!-- 71. Jia-Hong Chen#3863
 codepen: https://codepen.io/iloveleon19/pen/NWyxPro?editors=0010 -->
 
<!--  72. AllenLi#6756
 codepen: 
 https://codepen.io/knsybndf-the-animator/pen/vYdLEvV?editors=1011 -->
 
 <!--  73. Knn#0492
 codepen: 
https://codepen.io/Knn_84/pen/QWQyjax?editors=0010
-->

<!-- 74.Tsuei#9284
https://codepen.io/AlbertoLL/pen/XWZXXoM?editors=0011  
-->

<!-- 75.米金#1399
https://codepen.io/ihrowjtq-the-vuer/pen/oNEbxOr
-->

<!-- 76.楓之聲#6945
codepen:https://codepen.io/sshane258/pen/yLveaEY
-->

<!-- 77.Katie
codepen:https://codepen.io/Katie24/pen/KKQdGpN
-->

<!-- 78. Sussu#4211
codepen:https://codepen.io/yatiti84/pen/QWQydpm?editors=1111
-->

<!-- 79. Stella/UIUX/台北#7394
codepen:https://codepen.io/ting-juan-huang/pen/dydGNJM?editors=1111
-->

<!-- 80. Vivi#5766
codepen: 
https://codepen.io/hyxfish27/pen/YzewNdZ
-->

<!-- 81. 靜宜#6866
答案：（可直接撰寫答案）
Codepen：https://codepen.io/jamie18/pen/xxYZqdg
-->

<!-- 82. JumpBow#8940
Codepen：
https://codepen.io/jump-bow/pen/rNJxyrM?editors=0011
-->

<!-- 83. _Evan伊凡  
https://codepen.io/Evan_9837/pen/rNJxmKd
-->

<!-- 84. will0708#7730
https://codepen.io/ncrdpepc-the-lessful/pen/wvyMeqr?editors=0010
-->

<!-- 85. 白狐
Codepen：https://codepen.io/baihu7851/pen/xxYZLjd
-->

<!-- 86. Bao#4997
Codepen：https://codepen.io/baoh/pen/qBxbpJP?editors=0011
-->

<!-- 87. carrieT#9628
https://codepen.io/echocarriet/pen/dydGNZG
-->
<!-- 87. 鉦勝#8333
https://codepen.io/atckmax823/pen/LYQGdVK?editors=0011
-->
<!-- 88. Wei Kai#1867
Codepen: https://codepen.io/beginneraboutlife116/pen/poagajb
in the JS panel
-->

<!-- 89. zzuhann #2786
codepen: https://codepen.io/zzuhann/pen/YzewagN
-->

<!-- 90. Van.CS #2067
Codepen: https://codepen.io/fbacojji-the-selector/pen/BaYjxQO?editors=0012 
-->

<!-- 91. karakamin#3416
Codepen： https://codepen.io/karakamin/pen/KKQVezM?editors=0011
 -->
 
 <!-- 92. Cheng#3012
codepen: https://codepen.io/XiBinCheng/pen/YzewRrw
-->
 
 
 <!-- 92. RayCheb#6088
Codepen： https://codepen.io/raychen1996/pen/jOZWKwM
 -->
 
  <!-- 93. KuoMin#4931
Codepen： https://codepen.io/KuoMin/pen/dydGQzo
 -->
 
   <!-- 94. Cheng-Yu#1813
Codepen： 
https://codepen.io/ball77111/pen/abqdeGB
 -->
 
<!-- 94. WilliamChou#7375
Codepen： 
https://codepen.io/williampo78/pen/KKQzVqY
 -->
 
 <!-- 95. mei#8421
Codepen： 
https://codepen.io/Shila-Chen/pen/rNJeMgM
 -->
 <!-- 96. 安安你好你是誰#7416
Codepen： 
https://codepen.io/leave3310-the-looper/pen/KKQzNMV
 -->
 
 <!-- 97. TaoDoris#5230
Codepen： 
https://codepen.io/peetaoting/pen/LYQNVjB
 -->
 

  <!-- 98. Amberhh#2465
Codepen： 
https://codepen.io/Amberhh/pen/GRQZdxx?editors=0010
 -->
 
 <!-- 98. han#9437
Codepen： 
https://codepen.io/qnrxylcw-the-reactor/pen/MWQyBJV
 -->
 
 <!-- 99. BeckyYo#1461
 https://codepen.io/bearbecky/pen/ExQKqyY?editors=1111
 -->
 
 
  <!-- 100. EllieLo#9809
https://codepen.io/ellie-lo/pen/YzeWVZL?editors=0011
 -->
<!--   101. Pearlie#3536
https://codepen.io/PPcode/pen/qBxNYgq
-->

<!-- 102. Jill#5577
Repl.it: https://replit.com/@Jillkate/Hex-daliy-22-05-06#index.js 
-->

<!-- 103. Wilson#8687
Codepen： https://codepen.io/foolwilson/pen/poaEeBY
-->

<!-- 104. Lao#4012
Codepen:
https://codepen.io/rao418065/pen/vYdXZro?editors=0011
-->

<!-- 105. Cyndi#8308
codepen: https://codepen.io/swi963/pen/MWQyXWa?editors=0010
-->

<!-- 106. 101010#8077
codepen: https://codepen.io/im1010ioio/pen/NWyRwXr?editors=0012
-->

<!-- 107. Kiwi#9804
codepen: https://codepen.io/kiwi1113/pen/XWZjQQv
-->

<!-- 108. littlesun#9469
codepen: https://codepen.io/littlesun10111/pen/PoQbmXy
-->

<!-- 109. sheep#4352
codepen: https://codepen.io/chingyeeee/pen/PoQbKZN?editors=0010
-->

<!-- 110 YANSzero#5436
codepen:https://codepen.io/yanszero/pen/BaYQEWL
-->

<!-- 111 一隻阿貓#2726
codepen:https://codepen.io/chenchaoyen/pen/VwQmOKm
-->

<!-- 112. Chaoci#2460
codepen:https://codepen.io/gmailchao/pen/BaYppZE?editors=0010
-->

<!-- 113. Susan8402#5854
codepen:https://codepen.io/Susan8402/pen/gOvgEJJ?editors=0012
-->

<!--114. Vito#7797
https://codepen.io/Vito_Yang/pen/ZEreMQe?editors=0012
-->

<!--115. ewen#8354
codepen:https://codepen.io/ewen0808/pen/dydRVjb
-->

<!-- 116. Mitour#0672
 codepen:https://codepen.io/mitour/pen/abqwGNp
-->

<!-- 117. zera#6060
codepen : https://codepen.io/zera-tseng/pen/XWZadNV?editors=1011
-->

<!-- 118. Choo.Ku
codepen : https://codepen.io/chooku/pen/vYdJKxK?editors=0012
-->

<!-- 119. JessieCho
codepen : https://codepen.io/jessieCho/pen/ExQoZPo
-->

<!-- 120. How #5806
codepen : https://codepen.io/howtobefine/pen/VwQXZWp?editors=0010
-->

<!-- 121. 小金#3256
codepen: https://codepen.io/AmoGH357/pen/XWZBBYW
-->

<!-- 122. 眠瀾#8857
CodePen: https://codepen.io/laron9486/pen/xxYovoW
-->

<!-- 123. 黑白兔#0684
CodePen: https://codepen.io/johnny329/pen/oNqYdaG
-->

<!-- 124. Ayre#0016
CodePen: https://codepen.io/yichunlin09/pen/oNqeZNP?editors=0011
-->
<!-- 125. Ada
CodePen: https://codepen.io/zggsoagv-the-scripter/pen/GRxvWyg
-->

<!-- 126. Leone#0851
CodePen: https://codepen.io/Leoneboy/pen/bGvrrjB?editors=0011
 -->
 
 <!-- 127. Yanyan#3555
CodePen: https://codepen.io/wei-yi-lee/pen/zYWdzdo
-->

<!-- 128. Claire#2116
 codepen：https://codepen.io/claire-chang-the-bashful/pen/QWmMQvr -->

<!-- 128. SHIN#6075
CodePen: https://codepen.io/shin9626/pen/NWYvJeQ
-->

<!-- 130. xuan#0808
CodePen: https://codepen.io/xuan0915/pen/QWmgNZP?editors=0011
-->

<!-- 131. SunnyCheng#4113
CodePen: https://codepen.io/Sunny0509/pen/poLWpYw?editors=0011
-->

<!-- 132: huch09#1426
codepen: https://codepen.io/subarashii-huch09/pen/mdxqZQq?editors=1112 -->

<!-- 133: 家洋#6999
codepen:https://codepen.io/aa235553756/pen/qBopOxb -->


<!-- 134: DaleHsu#0355
codepen:https://codepen.io/dale_hsu/pen/YzaYxZe -->

<!-- 135: john21429
codepen:https://codepen.io/john21429/pen/abYYYvj-->

<!-- 136: JOU#6876
 codepen: https://codepen.io/joujoujou924/pen/OJvwrJP -->
 
 <!-- 137: Harmonia#3139
 codepen: https://codepen.io/corly74/pen/oNqmvZa?editors=0011 -->
 
 <!-- 138: Sophia19#4005
 codepen:
 https://codepen.io/sophia019/pen/abGOZpr -->

 <!-- 139: yolala#7070
 codepen:
https://codepen.io/chiakilalala/pen/BaVLqLv-->