---
# System prepended metadata

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

---

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

前情提要
---
#### 在物件內新增、修改、取得屬性的方法有以下兩種:

1. 點記法 (Dot notation)

```js=
let obj = {};
obj.key = value;  // 新增或修改
console.log(obj.key); // 取得
```

2. 括弧記法 (Bracket notation)
```js=
let obj = {};

// 當 key 的值帶有小數點或是空格時可以使用 (如 -- some.data)，記得要加上引號 (單引號或雙引號皆可)
obj['key'] = value;  // 新增或修改
console.log(obj['key']); // 取得
```

如果屬性一開始就存在，則以上的語法會更新該屬性的值; 反之則會建立一個新的屬性。

問題
---
請透過 console.log ，嘗試透過前面所介紹的 2 種方法依序輸出以下屬性:

```js=
let weather = {
    Country: "高雄",
    "PM2.5": 35,
    isSunny: false,
    rainingRegion: ['鼓山', '鹽埕', '旗津'],
    rainFall: {
        鼓山: 400,
        鹽埕: 300,
    }
} 

// 取得 Country 的值
console.log(); 

// 取得 "PM2.5" 的值
console.log();

// 取得 isSunny 的值
console.log(); 

// 取得 rainingRegion 陣列的第一個值 '鼓山'
console.log(); 

// 在 rainFall 新增一個屬性名為「旗津」、設定值為 200，並輸出答案
<!-- 程式碼撰寫處 -->
console.log();
```


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

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

<!-- 解答
// 取得 Country 的值
console.log(weather.Country);  //方法一
console.log(weather["Country"]);  //方法二


// 取得 "PM2.5" 的值
console.log(weather["PM2.5"]); 


// 取得 isSunny 的值
console.log(weather.isSunny);  //方法一
console.log(weather["isSunny"]);  //方法二


// 取得 rainingRegion 陣列的第一個值 '鼓山'
console.log(weather.rainingRegion[0]); 


// 在 rainFall 新增一個屬性名為「旗津」、設定值為 200，並輸出結果
weather.rainFall.旗津 = 200; //方法一
console.log(weather.rainFall.旗津);

weather["rainFall"]["旗津"] = 200; //方法二
console.log(weather["rainFall"]["旗津"]);
-->

|      Slack      |                              CodePen                               |
|:---------------:|:------------------------------------------------------------------:|
|   Karen Huang   |           https://codepen.io/Coding_Snorlax/pen/OJjmQGK            |
|    kevin嘉軒    |       https://codepen.io/kevin-chang-the-sasster/pen/wvqdmBB       |
|     CloThEs     |          https://codepen.io/bogwdnxx-the-sans/pen/gOxWeON          |
|       YC        |                https://codepen.io/YCLu/pen/BadRraa                 |
|      YuriT      |              https://codepen.io/wenfisht/pen/MWvmVgp               |
|    Aaron Tu     |               https://codepen.io/aarontu/pen/QWMvmbE               |
|   Iris Huang    |               https://codepen.io/ythuang/pen/LYjydVJ               |
|     Bonnie      |      https://codepen.io/bonnieli1414/pen/YzxVaXB?editors=0011      |
|      jojoy      |         https://codepen.io/jojoy/pen/PoKmRPY?editors=0011          |
|      米米       |      https://codepen.io/Jameshsu0407/pen/QWMvmdG?editors=0011      |
|     傅劍軒      |      https://codepen.io/seonkuraito/pen/vYJmRBb?editors=0010       |
|    AndyHuang    |             https://codepen.io/HsuHuaHuang/pen/ExvmEgL             |
| 有廖先生(Rain)  |             https://codepen.io/billpop741/pen/NWvjYjR              |
|      洋蔥       |  https://codepen.io/oikdkmxq-the-looper/pen/porPLVW?editors=0011   |
|      Louis      |      https://codepen.io/Louis164156/pen/PoKmRaN?editors=1010       |
|     Arista      |            https://codepen.io/arista-hsieh/pen/GRvmxGp             |
| Cheng Pei-hsuan |               https://codepen.io/PaCheng/pen/zYdGKpO               |
|     連小艾      |       https://codepen.io/bolaslien/pen/RwZVMBN?editors=0012        |
|       Leo       |              https://codepen.io/a86483451/pen/eYEWMKr              |
|     林小君      |          https://codepen.io/hcvbcjqq-the-vuer/pen/ZEJKxMo          |
|      lumei      |               https://codepen.io/l_umei/pen/JjyWVXo                |
|  Jun Ting Lin   |              https://codepen.io/jake1155/pen/mdMmxGJ               |
|     Tim Lin     |              https://codepen.io/TimmyLin/pen/OJjmvdb               |
|   ボンドルド    |              https://codepen.io/alan60108/pen/LYjydJo              |
|     POPEYE      |              https://codepen.io/popeye_ux/pen/NWvjYog              |
|   Peter Chen    |        https://codepen.io/yuckugjy-the-sasster/pen/oNeWdxX         |
|   Kelvin Hsu    |              https://codepen.io/kelvin001/pen/KKvmRze              |
|      傑瑞       |     https://codepen.io/auatwood909815/pen/xxLdjRK?editors=0011     |
|   Bella Shya    |        https://codepen.io/BellaXie/pen/PoKmeWj?editors=0011        |
|   Elaine Liu    |       https://codepen.io/elaine7598/pen/KKvmRVR?editors=0010       |
|     許閔翔      |        https://codepen.io/oupbzfxq-the-scripter/pen/rNzmvMR        |
|     蔡明達      |        https://codepen.io/bmzpfyxe/pen/NWgKQZB?editors=0011        |
|    danny123     |      https://codepen.io/binlandz123/pen/NWvjMzB?editors=0010       |
|      群嘉       |  https://codepen.io/efzdamnp-the-lessful/pen/MWvmGXR?editors=1011  |
|      Yunei      |                https://codepen.io/Yunei/pen/MWvmGqR                |
|       KK        |             https://codepen.io/potatokaka/pen/LYjymvb              |
|   Bean Huang    |       https://codepen.io/Beanhuang/pen/bGrWMym?editors=0010        |
|      溫溫       |        https://codepen.io/ZPXO1928/pen/KKvXJNe?editors=0010        |
|     艾瑞克      |         https://codepen.io/ericla/pen/PoKmeBE?editors=0011         |
|      Anna       |        https://codepen.io/kycrleao/pen/GRvmdbQ?editors=1011        |
|      Gill       |       https://codepen.io/Gill-Chin/pen/mdMmLNp?editors=0011        |
|     鄭安志      |        https://codepen.io/lwmtsgek/pen/WNEjybP?editors=0011        |
|   Steven Chan   |       https://codepen.io/Steven1220/pen/PoKmapy?editors=1011       |
|     Jie Du      | https://codepen.io/qgqonost-the-flexboxer/pen/xxLdzPr?editors=0011 |
|   Ellen Chen    |            https://codepen.io/ellenchialin/pen/xxLdzpr             |
|      Alvin      |     https://codepen.io/Alvin20201116/pen/eYEWKez?editors=0011      |
|       Sam       |               https://codepen.io/sam-hsu/pen/gOxWKvZ               |
|     Hamaji      |             https://codepen.io/hamajibashi/pen/porPVKG             |
|      張喆       |               https://codepen.io/wow767t/pen/jOLmKeP               |
|      小不       |            https://codepen.io/SharonWu1987/pen/eYEWKbg             |
|     ZY Hsu      |         https://codepen.io/zihyin/pen/VwzbBeq?editors=0011         |
|    Pei Ying     |        https://codepen.io/Pei-Ying/pen/QWMvBdG?editors=0011        |
|     陳暐中      |         https://codepen.io/wei-z/pen/WNEjKRG?editors=0012          |
|    PeggyTsai    |      https://codepen.io/pei-chi-tsai/pen/VwzpRdw?editors=0011      |
|      鉦勝       |       https://codepen.io/atckmax823/pen/Exvmpbp?editors=0011       |
|      吐司       |              https://codepen.io/malolulu/pen/gOxWzMm               |
|      Phil       | https://codepen.io/ctkeftjp-the-animator/pen/mdMmGqm?editors=0011  |
|     Jasper      |              https://codepen.io/li-jasper/pen/MWvmPKW              |
|      Genos      |              https://codepen.io/pb220416/pen/mdMmzEL               |
|    Sylvia-H     |      https://codepen.io/Cosmosheart/pen/rNzmqwL?editors=0011       |
|       phi       |       https://codepen.io/aiya861202/pen/eYEmVjR?editors=1111       |
|      阿和       |         https://codepen.io/shnny/pen/Exvmdrv?editors=0011          |
|      陳sam      |        https://codepen.io/euldpliv/pen/MWvmzap?editors=1012        |
|     Hsiang      |       https://codepen.io/chao20211/pen/eYEWQJE?editors=0010        |
|      Riley      |              https://codepen.io/jjpxbprd/pen/OJjmaXJ               |
|      Ching      |       https://codepen.io/Jaimedede/pen/LYjyXNJ?editors=1010        |
|       Aya       |             https://codepen.io/NoNameNote/pen/OJjmajy              |
|     Yvonne      |         https://codepen.io/Evonne/pen/vYJmQQY?editors=0011         |
|       Gui       |              https://codepen.io/guitimliu/pen/LYjyXQq              |
|     Booker      |           https://codepen.io/bookbasketball/pen/BadRvLd            |
|     柯勝華      |       https://codepen.io/Chill-Nick/pen/oNeWmjW?editors=0010       |
|       Lai       |         https://codepen.io/co_lai/pen/XWaROKX?editors=0011         |
|   Yashien Lin   |       https://codepen.io/YashienLin/pen/jOLmJWr?editors=0012       |
|     Alberto     |       https://codepen.io/AlbertoLL/pen/KKvmYvB?editors=0012        |
|     Jocelyn     |              https://codepen.io/enjoyful/pen/NWvjmOB               |
|    lingxuan     |      https://codepen.io/penglingxuan/pen/dyzWLLN?editors=0011      |
|     kailun      |               https://codepen.io/Kailun/pen/rNzQVJg                |
|     Celeste     |              https://codepen.io/Celeste17/pen/wvqJboZ              |
|      Calon      |              https://codepen.io/Calon0118/pen/mdMmYQQ              |
|      Yunyi      |             https://codepen.io/yunyi12374/pen/ZEJbKVW              |
|   Jean Chiang   |           https://codepen.io/jeanchiang1221/pen/jOLmjZB            |
|     Trista      |             https://codepen.io/trista6140/pen/YzxVmZq              |
|    Jyun Chen    |         https://codepen.io/Jyun_C/pen/KKvqPyP?editors=1111         |
|      Sandy      |        https://codepen.io/Sandy_L/pen/bGrRbJb?editors=0011         |
|      肉魚       |              https://codepen.io/zoechen13/pen/VwzWwLE              |
|     蔣秉彣      |       https://codepen.io/the-pierre/pen/RwZporY?editors=0010       |
|     黃士桓      |     https://codepen.io/shr-huan-huang/pen/porwvoa?editors=0011     |
|      YOYO       |        https://codepen.io/lumedkle/pen/abywbrP?editors=1111        |
|      大衛       |        https://codepen.io/exnsrpjc/pen/gOxRrbv?editors=0011        |
|      fyfy       |        https://codepen.io/fyfy1217/pen/MWvoeEv?editors=0011        |
|       YOf       |        https://codepen.io/yangyof/pen/dyzRWgd?editors=0010         |
|    GrayShine    |       https://codepen.io/grayshine/pen/ExvXXdp?editors=0010        |
|   Irene Wang    |        https://codepen.io/irene-wang-the-looper/pen/yLoXzpL        |
|    kevinhes     |        https://codepen.io/kevinhes/pen/YzxQrja?editors=0012        |
|   Metis Teng    |       https://codepen.io/metis-teng/pen/RwZgLze?editors=0012       |
|     Jessie      |              https://codepen.io/jssanji03/pen/vYJZWBV              |
|     劉維倫      |        https://codepen.io/lun0223/pen/yLoXPWP?editors=1012         |
|    Chia Chi     |       https://codepen.io/ClaraChen/pen/oNewoKR?editors=0011        |
|     ZOE WU      |       https://codepen.io/Zoechiueh/pen/RwZgQwZ?editors=0011        |
|       小K       |       https://codepen.io/kelen1995/pen/wvqejJe?editors=0012        |
|     Shaun43     |               https://codepen.io/i418063/pen/eYERrMx               |
|    debby yeh    |        https://codepen.io/bhliyoup/pen/gOxRjYq?editors=0011        |
|     Mingyo      |        https://codepen.io/Nick-Yo/pen/OJjgBJQ?editors=0011         |
|     Jun Hua     |              https://codepen.io/ydsyvkph/pen/yLooYLY               |
|      雪莉       |             https://codepen.io/utshang216/pen/xxLLEEM              |
|    Vicky Kao    |             https://codepen.io/vicky03035/pen/vYJJmKm              |
|      喜美       |       https://codepen.io/Candace802/pen/ZEJJaOO?editors=0010       |
|   Zooey Cheng   |      https://codepen.io/noraneko0430/pen/gOxxXvJ?editors=0012      |
|       AKI       |              https://codepen.io/akichen27/pen/ZEJJmWW              |
|  YU-LING TUNG   |        https://codepen.io/igzdflpu/pen/ExvvGYL?editors=0010        |
|     Tingyu      |         https://codepen.io/dgltu/pen/yLoomKv?editors=0011          |
|       zyc       |                https://codepen.io/zy_c/pen/rNzGKWR                 |
|    Page Shih    |             https://codepen.io/kanawin821/pen/PoKJdvG              |
|Van.S|https://codepen.io/fbacojji-the-selector/pen/xxLXNJG?editors=0011 |
|UnizaLin|https://codepen.io/unizalin/pen/YzxrmWB |
| ShinyChen | https://codepen.io/shinychen/pen/pordjQj |
| LTL | https://codepen.io/ltlin93/pen/jOLYbVX |
|Cadiis| https://codepen.io/candiyen/pen/ExvozBz |
|阿修| https://codepen.io/edw-kyo/pen/RwZjjOY |
| 三隻小貓 | https://codepen.io/bagelover/pen/WNEMqMy?editors=0011 |
|zaii|https://codepen.io/ivy2846357/pen/MWvPYzB?editors=0010|
paul|https://codepen.io/printfootya/pen/wvqZYeV?editors=0011
