---
# System prepended metadata

title: "\U0001F3C5 DAY34 每日任務"
tags: [JS 直播班  - 2021 秋季班]

---

# 🏅 DAY34 每日任務
###### tags: `JS 直播班  - 2021 秋季班`

Object.keys(), Object.values() 使用練習
---
* Object.keys() 可以取得指定物件的所有 key 值，並回傳一個陣列。
* Object.values() 可以取得指定物件的所有 value 值，並回傳一個陣列。

```js=
const object1 = {
  a: "字串",
  b: 42,
  c: false
};

console.log(Object.keys(object1)); // 結果: ["a", "b", "c"]
console.log(Object.values(object1)); // 結果: ["字串", 42, false]

```

問題
---

請練習使用 Object.keys()，修改資料格式，並存入名稱為 answer 的物件，格式如下圖:

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

範例程式碼:
```js=
let answer = {}; // 請把修改完的資料存入 answer 物件。
let url = "https://raw.githubusercontent.com/hexschool/js-traninging-week6API/main/data.json";
axios.get(url)
.then((response) => {
    let total = {};
    let data = response.data;

    data.forEach((item, i) => {
      if(total[item.jsGroup] === undefined) {
         total[item.jsGroup] = 1;
      }else {
        total[item.jsGroup] += 1;
      }
    })
    /*程式碼開始*/


    /*程式碼結束*/
    console.log(answer);
 })
```


回報流程
---
將答案寫在 CodePen 並複製 CodePen 連結貼至 thread 中回報就算完成了喔! 解答請參考下圖（需打開程式碼的部分觀看）

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

<!-- 解答
https://codepen.io/znlcgmgk/pen/abpmPGo
-->

|      Slack       |       CodePen       |
|:----------------:|:-------------------:|
|   Karen Huang    |  https://codepen.io/Coding_Snorlax/pen/yLodLXX?editors=1111 | 
| 蔡明達 | https://codepen.io/bmzpfyxe/pen/NWgKQZB?editors=0012 |
|Aaron Tu|https://codepen.io/aarontu/pen/eYEwLrx
|    Iris Huang    |    https://codepen.io/ythuang/pen/ZEJdMxV    |
|CloThEs | https://codepen.io/bogwdnxx-the-sans/pen/LYjKJXG|
Tim Lin|https://codepen.io/TimmyLin/pen/ZEJdMmP?editors=1012 |
| Sam | https://codepen.io/sam-hsu/pen/qBXzMgO |
|有廖先生(Rain)|https://codepen.io/billpop741/pen/vYJqzPx|
|POPEYE | https://codepen.io/popeye_ux/pen/qBXzMMd |
|Bonnie | https://codepen.io/bonnieli1414/pen/RwZzYYK?editors=1011|
|lumei|https://codepen.io/l_umei/pen/RwZzeGj|
|Gill|https://codepen.io/Gill-Chin/pen/QWMXZbJ?editors=1011|
|張喆|https://codepen.io/wow767t/pen/WNEqaEm|
|jojoy|https://codepen.io/jojoy/pen/rNzEqLa?editors=0011|
| Jun Ting Lin | https://codepen.io/jake1155/pen/yLodRbm |
| Yunei | https://codepen.io/Yunei/pen/wvqLYXN |
| YC | https://codepen.io/YCLu/pen/VwzJEbz |
| Elaine Liu | https://codepen.io/elaine7598/pen/XWaLxWW?editors=0010 |
| Pei Ying | https://codepen.io/Pei-Ying/pen/mdMZzNQ?editors=1011 |
| Bean Huang | https://codepen.io/Beanhuang/pen/RwZzqLO?editors=0011 |
|洋蔥|https://codepen.io/oikdkmxq-the-looper/pen/MWvMzjJ?editors=0012|
| Bella Shya | https://codepen.io/BellaXie/pen/BadgGZa?editors=1111 |
| 米米 | https://codepen.io/Jameshsu0407/pen/KKvjbVZ?editors=0012 |
| Louis | https://codepen.io/Louis164156/pen/rNzEoog?editors=1111 |
|kk|https://codepen.io/potatokaka/pen/abygaPb|
|AKI|https://codepen.io/akichen27/pen/jOLjXXv|
|Phil |https://codepen.io/ctkeftjp-the-animator/pen/abygPqg?editors=0011 |
|Calon|https://codepen.io/Calon0118/pen/BadgMbb|
| Peter Chen | https://codepen.io/yuckugjy-the-sasster/pen/qBXzvQQ?editors=1112 |
| yuriT | https://codepen.io/wenfisht/pen/VwzJRbV |
|群嘉|https://codepen.io/efzdamnp-the-lessful/pen/zYdVbgJ?editors=1012|
|陳暐中|https://codepen.io/wei-z/pen/QWMXRQR?editors=0012|
|yunyi|https://codepen.io/yunyi12374/pen/ZEJbKVW|
|tingyu|https://codepen.io/dgltu/pen/abyezYg?editors=1112|
| Steven Chan |https://codepen.io/Steven1220/pen/MWvNwjM?editors=0011 |
| 傅劍軒 | https://codepen.io/seonkuraito/pen/VwzJqXe?editors=0012 |
| 連小艾 | https://codepen.io/bolaslien/pen/qBXeRGQ?editors=0012 |
| Kelvin Hsu | https://codepen.io/kelvin001/pen/MWvNpgO?editors=1111 |
|大衛|https://codepen.io/exnsrpjc/pen/OJjKpRR?editors=0011|
|吉兒| https://codepen.io/Jillkate/pen/porMPjq |
|ZY Hsu| https://codepen.io/zihyin/pen/ZEJgxBp?editors=1011|
| 黃士桓 | https://codepen.io/shr-huan-huang/pen/MWvNBqm?editors=0012 |
|Jasper|https://codepen.io/li-jasper/pen/NWaKNbM
| 雪莉 | https://codepen.io/utshang216/pen/GRMKvNR |
|Jocelyn|https://codepen.io/enjoyful/pen/WNZeLQw?editors=0012|
| Lai | https://codepen.io/co_lai/pen/PoJYLZB?editors=1011 |
|小K| https://codepen.io/kelen1995/pen/LYzPaLz |
|Gui|https://codepen.io/guitimliu/pen/QWqLYXY|
| 劉維倫 | https://codepen.io/lun0223/pen/QWqLPmv?editors=0011 |
| Yashien Lin | https://codepen.io/YashienLin/pen/eYGOXPg?editors=1012 |
|鄭安志|https://codepen.io/lwmtsgek/pen/xxXxPrg?editors=0011|
|danny123|https://codepen.io/binlandz123/pen/Yzrzaee?editors=1011 |
|Genos|https://codepen.io/pb220416/pen/mdBdKmr|
| Riley | https://codepen.io/jjpxbprd/pen/KKXKbVz|
|PeggyTsai|https://codepen.io/pei-chi-tsai/pen/LYzEbLw?editors=0011|
|phi|https://codepen.io/aiya861202/pen/poWooom?editors=1111|
paul|https://codepen.io/printfootya/pen/OJxPWVz?editors=1012|
|乃萱|https://codepen.io/nainaikuo/pen/Bawyxgo?editors=0011|
|YOYO|https://codepen.io/lumedkle/pen/GRMgVGL?editors=0011|
| ZOE WU | https://codepen.io/Zoechiueh/pen/ZEXGGba?editors=0012 |
|阿和|https://codepen.io/shnny/pen/PoJqqXW?editors=0011|
|Sandy|https://codepen.io/Sandy_L/pen/MWEwjZJ?editors=0011|
| Sylvia-H | https://codepen.io/Cosmosheart/pen/RwLPqgK |
|Alvin|https://codepen.io/Alvin20201116/pen/PoJqxre?editors=1011|
|kailun|https://codepen.io/Kailun/pen/gOGPvJO|
|許閔翔|https://codepen.io/oupbzfxq-the-scripter/pen/WNZwjLQ?editors=1111|
|蔣秉彣|https://codepen.io/the-pierre/pen/XWejWxE?editors=0011|
|Clara|https://codepen.io/ClaraChen/pen/LYzbmYJ?editors=1011|
|Hamaji| https://codepen.io/hamajibashi/pen/GRMNXBo |
|Trista| https://codepen.io/trista6140/pen/VwMPrjz |
| Aya | https://codepen.io/NoNameNote/pen/xxXqJZG | 
| 
