---
# System prepended metadata

title: "\U0001F3C5 5/23(一) 每日 JS 刷題任務 - 陣列物件資料處理"
tags: [公益程式體驗營 - 2022]

---

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

# 🏅 5/23(一) 每日 JS 刷題任務 - 陣列物件資料處理

### 題目一：物件加值
* 請透過 `addContent` 函式，來增減 `obj` 物件內容。
``` =JavaScript
const obj = {
    sons:[]
}
// input 輸入
addContent("Bob")
addContent("Tom")

// output 輸出 obj 的結果
{
    sons:["Bob"]
}

{
    sons:["Bob","Tom"]
}
```

### 題目二：
* 請透過 `addContent2` 函式，來增減 `obj2` 陣列內容。
``` =JavaScript
const obj2 = []
// input 輸入
addContent2("Bob")
addContent2("Tom")

// output 輸出 obj2 的結果
[
    {name:"Bob"}
]


[
    {name:"Bob"},
    {name:"Tom"},
]
```

### 題目三：
* 請透過 `addContent3` 函式，來增加 `obj3` 物件內容。
``` =JavaScript
const obj3 = {
    male:0,
    female:0
}
// input 輸入
addContent3("male")
addContent3("male")
addContent3("female")
// output 輸出 obj3 的結果
{
    male:1,
    female:0
}


{
    male:2,
    female:0
}

{
    male:2,
    female:1
}
```


## 回報流程

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/VwQWwXb?editors=0011
-->

<!-- 2. shijia
Codepen: https://codepen.io/shijia22/pen/LYQLXbV?editors=0011 -->

<!-- ３. 鉦勝
Codepen: https://codepen.io/atckmax823/pen/NWyvppJ?editors=0011 -->


<!--  4. Rex Chu
Codepen:
https://codepen.io/rex_chu/pen/mdXMXxb
-->

<!--  5. yunyun
Codepen:
https://codepen.io/yun_yunni/pen/XWZaZqE
-->

<!--  6. Jason Chen
Codepen:
https://codepen.io/jason60810/pen/dydzmob
-->

<!--  7. Stanley 
Codepen:
https://codepen.io/sean_1215/pen/KKQvQOy?editors=1112
-->

<!--  8. yuyu#6310
Codepen:
https://codepen.io/yuyu0905/pen/WNMEzXz?editors=0012
-->

<!--  8. CloThEs
Codepen:
https://codepen.io/bogwdnxx-the-sans/pen/LYQjdzE
-->

<!-- 9. 楓之聲#6945
Codepen:
https://codepen.io/sshane258/pen/VwQzXNP 
-->

<!-- 10. hsiuhsiu
Codepen:
https://codepen.io/hsiuhsiu/pen/mdXMxrE?editors=0011
-->

<!-- 11. Noy
https://codepen.io/MochiCodingPen/pen/KKQvoEb
-->

<!-- 12. Peng
https://codepen.io/peng-027/pen/WNMEzKy?editors=1111
 -->
 
 <!-- 13. 小鹿Kerwin#5730
https://codepen.io/tkoleo84119/pen/VwQzxeW?editors=0012
 -->
 
<!-- 14. hw#0715
https://codepen.io/Lhwei/pen/LYQjmbW  
-->

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

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

<!-- 17. Aaron803
Codepen : https://codepen.io/narrowd4c/pen/GRQJoJP
-->

<!-- 18. Xiang#5313
Codepen : https://codepen.io/snorlaxxu/pen/BaYdxVM?editors=0010
-->

<!-- 19. Chi
Codepen: https://codepen.io/YoChi84/pen/gOvxKwN
-->

<!-- 20. han#9437
Codepen: https://codepen.io/qnrxylcw-the-reactor/pen/NWyvzdG
-->

<!-- 21. Mitour#0672
 https://codepen.io/mitour/pen/zYRdLOm
-->

<!-- 22.IreneLee
codepen:https://codepen.io/ntjtcxpt-the-animator/pen/PoQKBwG?editors=0012 
-->

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

<!-- 23. SASIMI#5099
codepen:
https://codepen.io/sashimi1327/pen/qBxXyoE
-->
<!-- 24. Sweet
codepen:
https://codepen.io/Pei-Ying/pen/VwQzXVm?editors=1111
-->

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

<!-- 26. Josh Chen#4552
Codepen:
https://codepen.io/hiphop825/pen/LYQjJjL?editors=0010
-->

<!-- 27. Josh bonnieli1414#4906
Codepen:
https://codepen.io/bonnieli1414/pen/LYQjgyJ?editors=0010
-->

<!-- 28. lyle#8123
Codepen:
https://codepen.io/tomys/pen/RwQZeEb?editors=0010
-->

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


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

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

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

<!--33. Arista
https://codepen.io/arista-hsieh/pen/rNJzRmo
-->

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

<!--35. Katie
https://codepen.io/Katie24/pen/zYRdbbO
-->

<!--36. KuoMin#4931
https://codepen.io/KuoMin/pen/VwQzNRx
-->

<!--37. Easton#3863
Codepen: https://hackmd.io/lumPURHFQKStQ_LLpfAzTg
-->

<!--38. Charlotte Lee
Codepen: https://codepen.io/charlotte-lee/pen/yLvoWoM?editors=0012
-->

<!-- 39. Nat#5891
https://codepen.io/dxnqcnen/pen/mdXMZam -->


<!-- 40.Lemon
https://codepen.io/shumhoyin/pen/mdXMNgz
-->

<!-- 41.bakiii
  https://codepen.io/aki168/pen/dydVPoN-->
  
  
<!-- 42.Raymond Lam#0344
https://codepen.io/manshun-lam/pen/dydVPQJ?editors=1112
-->

<!-- 43. Murmurline#6969
https://codepen.io/murmurline/pen/NWyaxNL
-->

<!-- 44. Chaco
https://codepen.io/chaco-wang/pen/mdXBwwP?editors=1011
-->

<!-- 45. TaoDoris#5230
https://codepen.io/peetaoting/pen/MWQErGW?editors=0011
-->

<!-- 46. Lina Chen
https://codepen.io/LinaChen/pen/MWQEXwK
-->
<!-- 47. 隔壁小王
https://codepen.io/stevetanus/pen/vYdeaPX 
-->

<!-- 48. WilliamChou#7375
https://codepen.io/williampo78/pen/wvyPaJL 
-->

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

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

<!-- 51.Ayre#0016
codepen: https://codepen.io/yichunlin09/pen/oNqGEgR?editors=0011
-->

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


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

<!--54. xuan#0808
  codepen:https://codepen.io/xuan0915/pen/oNqdvyd?editors=0011-->
  
<!-- 55. Neuf#3083
 codepen: https://codepen.io/yifanneuf/pen/OJvKOZq?editors=1111-->