---
# System prepended metadata

title: "\U0001F3C5 5/16(一) 每日 JS 刷題任務 - 陣列設計"
tags: [公益程式體驗營 - 2022]

---

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

# 🏅 5/16(一) 每日 JS 刷題任務 - 陣列設計


### 題目一：陣列長度計算

``` =JavaScript
// input 輸入
checkLength([1,2,3])
checkLength([5,8,39,1,2,3])
checkLength([])

// output 輸出
3
6
0
```
### 題目二：增減陣列內容
* 請透過 `aryControl` 函式，來增減 `ary` 陣列內容。
``` =JavaScript
const ary = [];
// input 輸入
aryControl("增加","black")
aryControl("增加","red")
aryControl("增加","white")
aryControl("增加","blue")
aryControl("刪除指定筆數",3)
aryControl("刪除指定筆數",1)

// output 輸出
["black"]
["red","black"]
["white","red","black"]
["blue","white","red","black"]
["blue","white","black"]
["white","black"]
```

### 題目三：for+陣列相加產生器，邏輯思考題
* 請嘗試用 `numAry` 變數，並搭配 `addAry` 函式來解此題目
``` =JavaScript
const numAry = [1,2,3,4,5]
// input 輸入
addAry(1);
addAry(2);
addAry(3);
addAry(4);
addAry(5);
// output 輸出
1
3
6
10
15
```


## 回報流程

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

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

<!-- 解答：  -->


回報區
---

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

<!-- 1. Bruno Yu（回報範例，請使用註解回報）
答案：（可直接撰寫答案）
Codepen：https://codepen.io/bruno-yu/pen/PoQGNNB?editors=0012
-->

<!-- 1. yunyun
答案：
Codepen：https://codepen.io/yun_yunni/pen/gOvgPVm
-->

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

<!-- 4. Chi
 Codepen: https://codepen.io/YoChi84/pen/ZErLWrg
-->

<!-- 5. Jia-Hong Chen#3863
 Codepen: https://codepen.io/iloveleon19/pen/yLvgOxd?editors=0010
-->

<!-- 6. yuyu#6310
 Codepen: https://codepen.io/yuyu0905/pen/OJQWNqo?editors=0011
-->

<!-- 7. Art
https://codepen.io/pen/?editors=0011
-->

<!-- 8. Chaco #2993
https://codepen.io/chaco-wang/pen/WNMRwLP?editors=1011
-->

<!-- 9. Jason Chen 
https://codepen.io/jason60810/pen/QWQdNZY
-->

<!-- 10. Joyce
https://codepen.io/joycehuang/pen/WNMRxGV?editors=0111
-->

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

<!-- 12. Noy
https://codepen.io/MochiCodingPen/pen/eYVgzLW?editors=1111
-->

<!-- 13. Knn#0492
https://codepen.io/Knn_84/pen/XWZpKLV?editors=0010
-->

<!-- 14. Tuhacrt#0008
https://codepen.io/Tuhacrt/pen/NWydrZx?editors=0011
-->

<!-- 15. su#7798
codepen: https://codepen.io/wc-su/pen/LYQxRya
-->

<!-- 16.IreneLee
 codepen:
https://codepen.io/ntjtcxpt-the-animator/pen/OJQbqPr?editors=0011
-->

<!-- 17. Wilson#8687
codepen: https://codepen.io/foolwilson/pen/eYVgdyK
-->

<!-- 18. Peng
https://codepen.io/peng-027/pen/NWydRQX?editors=0010
 -->
 
 <!-- 19. Stanley#3825
https://codepen.io/sean_1215/pen/xxYgRGK?editors=1011
 -->
 
 <!-- 20. KuoMin#4931
https://codepen.io/KuoMin/pen/xxYgOej
 -->
 
  <!-- 21. 小鹿Kerwin#5730
https://codepen.io/tkoleo84119/pen/MWQJJKa?editors=0002
 -->
 
 <!-- 22. Aaron803
Codepen : https://codepen.io/narrowd4c/pen/GRQJoJP
-->

 <!-- 23. andersonshen#4675
Codepen : https://codepen.io/luxyenni-the-bold/pen/yLvgMKv
-->

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

<!-- 25. lyle#8123
Codepen : 
https://codepen.io/tomys/pen/BaYpRWJ?editors=0011
-->

<!-- 26. Xiang#5313
Codepen : 
https://codepen.io/snorlaxxu/pen/bGLgRoX
-->

<!-- 27. Katie
Codepen : 
https://codepen.io/Katie24/pen/mdXRrxe
-->



<!-- 28. RayChen#6088
Codepen : 
https://codepen.io/raychen1996/pen/VwQPzJv
-->

<!-- 29. RyanLu#3642
Codepen : 
https://codepen.io/ryanlu1125/pen/BaYpdzj?editors=0012
-->

<!-- 30. Arista
Codepen : 
https://codepen.io/arista-hsieh/pen/dydNZGZ
-->

<!-- 31.  TaoDoris#5230
Codepen : 
https://codepen.io/peetaoting/pen/yLvgzwm?editors=0012
-->

<!-- 32. shujhen#7734
Codepen：https://codepen.io/shujhen/pen/dydNROd
-->

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

<!-- 34. Easton#3863
Codepen: https://codepen.io/EastonIsCodingNow/pen/zYRNPJd
-->

<!-- 35. hw#0715
https://codepen.io/Lhwei/pen/wvygmWN 
-->

<!-- 36. Pearlie#3536
https://codepen.io/PPcode/pen/dydNKXG
-->

<!-- 36. bonnieli1414#4906
https://codepen.io/bonnieli1414/pen/ZErLMox?editors=0010
-->

<!-- 36. Raymond Lam#0344
https://codepen.io/manshun-lam/pen/LYQxZzQ?editors=1111
-->

<!-- 37.bakiii#3652
  https://codepen.io/aki168/pen/BaYpXmK-->
  
<!-- 38.EllieLo#9809
  https://codepen.io/ellie-lo/pen/yLvMBVx?editors=0111 
-->

<!-- 39.WilliamChou#7375
  https://codepen.io/williampo78/pen/poaeJaQ 
-->

<!-- 40.JustilLiu
Codepen: https://codepen.io/justin0227/pen/OJQpLRg?editors=0011
-->

<!-- 40.hsiuhsiu
Codepen: https://codepen.io/hsiuhsiu/pen/PoQpZzY?editors=0012
-->

<!-- 41. Lina Chen
Codepen: https://codepen.io/LinaChen/pen/XWZpqBP
-->

<!-- 42. hsiehld#2395
Codepen: https://codepen.io/hsiehld/pen/VwQPaZe
-->

<!-- 43. 安安你好你是誰#7416
Codepen: https://codepen.io/leave3310-the-looper/pen/zYRZmPX
-->

<!-- 44. Chaoci#2460
Codepen:https://codepen.io/gmailchao/pen/xxYqMQb?editors=0010
-->

<!-- 45. Murmurline#6969
Codepen:https://codepen.io/murmurline/pen/KKQWOMz
-->

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

<!-- 47. Mojito#6002
 codepen: https://codepen.io/vu3xk41997/pen/jOZmbPQ
-->

<!-- 48. Cheng-Yu#1813
 codepen: https://codepen.io/ball77111/pen/mdXmqmq?editors=0011
-->

<!-- 49. 小王求職中
Codepen:
https://codepen.io/stevetanus/pen/VwQbQYJ
-->

<!-- 50. 亞芽 #1185
Codepen:
https://codepen.io/sanahsu/pen/RwQVyVE?editors=1011
-->

<!-- 51. ChaoChao
https://codepen.io/EmiiilyJ/pen/VwQbROy
-->

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

<!-- 53.Charlotte Lee
https://codepen.io/charlotte-lee/pen/OJQjMQd?editors=0012
-->

<!-- 54. Mitour#0672
codepen: https://codepen.io/mitour/pen/ZErJBze-->

<!-- 55 Patti Chiu Patti#7774 
codepen: https://codepen.io/peiru-qiu/pen/wvygXmj?editors=0011
-->

<!-- 56 Greta#0837
codepen: https://codepen.io/gretali/pen/WNMEYYy

<!-- 56 Sussu#4211
codepen: https://codepen.io/yatiti84/pen/dydZpdN?editors=1111

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


<!-- 59. Yanyan#3555
codepen: https://codepen.io/wei-yi-lee/pen/NWYvXgr
-->

<!-- 60. Ayre#0016
codepen: https://codepen.io/yichunlin09/pen/OJvjaYY?editors=0010
-->

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


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

<!-- 63. xuan#0808
 codepen :https://codepen.io/xuan0915/pen/ZExrmgP?editors=0011-->
 
<!-- 64: Neuf#3083
 codepen: https://codepen.io/yifanneuf/pen/xxWozJO-->
 
 <!-- 65: 黑白兔#0684
 codepen: https://codepen.io/johnny329/pen/OJZjEYK?editors=1011>