---
# System prepended metadata

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

---

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

函式觀念三
---
建議同學都將以下程式碼貼入 CodePen 執行、觀察結果。


### 函式參數觀念 ([參考章節1](https://courses.hexschool.com/courses/20201113/lectures/34094709)、[參考章節2](https://courses.hexschool.com/courses/20201113/lectures/34094710))

1. 函式可以帶入自定義的參數 (在此為 num1, num2)，並在呼叫函式的時候傳入。
```js=
function callNum(num1, num2){
    let total = num1 + num2;
    console.log(total);
}
// num1 等於 1, num2 等於 2
callNum(1, 2);
// num1 等於 2, num2 等於 4
callNum(2, 4);
```

2. 參數只存活在大括號。

```js=
function callNum(num){
    // 在此可以成功呼叫 num
    console.log(num);
}
callNum(1);
// 函數外部不可以呼叫 num，這行會報錯
console.log(num);
```


問題
---
請親自撰寫一次以上觀念的程式碼，並可以用註解強化知識點。


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

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



| Slack  |                 CodePen                 |
|:------:|:---------------------------------------:|
| 蔡明達 | https://codepen.io/bmzpfyxe/pen/NWgKQZB |
|Karen Huang|https://codepen.io/Coding_Snorlax/pen/OJjzaqo|
|CloThEs | https://codepen.io/bogwdnxx-the-sans/pen/LYjeXoL|
| Aaron Tu | https://codepen.io/aarontu/pen/oNepQre |
| YC |https://codepen.io/YCLu/pen/MWvrZgw |
| Iris Huang | https://codepen.io/ythuang/pen/oNepQOe |
| 蔣秉彣 | https://codepen.io/the-pierre/pen/bGrojWJ?editors=0010 |
Tim Lin|https://codepen.io/TimmyLin/pen/jOLYXPN
|有廖先生(Rain)|https://codepen.io/billpop741/pen/RwZxqzM|
|洋蔥|https://codepen.io/oikdkmxq-the-looper/pen/zYdpyKZ?editors=0011|
|米米|https://codepen.io/Jameshsu0407/pen/vYJpvKr?editors=0011|
|jojoy|https://codepen.io/jojoy/pen/LYjeMRe?editors=0011|
|Bonnie|https://codepen.io/bonnieli1414/pen/JjyMwbr?editors=0010|
|Andy Huang|https://codepen.io/HsuHuaHuang/pen/GRvyPWP |
|群嘉|https://codepen.io/efzdamnp-the-lessful/pen/MWvrZvj?editors=1111|
| Sam | https://codepen.io/sam-hsu/pen/BadJvdg |
| 劉維倫 | https://codepen.io/lun0223/pen/porpqpy?editors=1010 |
| Elaine Liu | https://codepen.io/elaine7598/pen/yLopGoO?editors=0010 |
| POPEYE |https://codepen.io/popeye_ux/pen/YzxYRMY |
|大衛|https://codepen.io/exnsrpjc/pen/qBXpLoo?editors=0010|
|lumei|https://codepen.io/l_umei/pen/jOLYXvq |
| 連小艾 | https://codepen.io/bolaslien/pen/BadJvOB?editors=0012 |
| KK | https://codepen.io/potatokaka/pen/PoKEXyM |
| Peter Chen |https://codepen.io/yuckugjy-the-sasster/pen/abyEPQq |
| Jun Ting Lin | https://codepen.io/jake1155/pen/bGraOzV |
| Gill | https://codepen.io/Gill-Chin/pen/dyzJYON |
| Genos | https://codepen.io/pb220416/pen/NWvXoPr |
| Lai | https://codepen.io/co_lai/pen/MWvrLVG?editors=0011 |
| ShinyChen | https://codepen.io/shinychen/pen/YzxYBEz |
| Yunei | https://codepen.io/Yunei/pen/qBXpgMe |
| Bean Huang | https://codepen.io/Beanhuang/pen/JjyMzjj?editors=0011 |
| YOYO | https://codepen.io/lumedkle/pen/yLopZzv?editors=1111 |
|Phil |https://codepen.io/ctkeftjp-the-animator/pen/dyzJrXX?editors=0011 |
|陳暐中 |https://codepen.io/wei-z/pen/ZEJvPVE?editors=0011 |
|Arista |https://codepen.io/arista-hsieh/pen/LYjeaay |
| ZOE WU | https://codepen.io/Zoechiueh/pen/ExvoMzg?editors=0011 |
| Riley | https://codepen.io/jjpxbprd/pen/KKvZYKP|
|Peggy Tsai|https://codepen.io/pei-chi-tsai/pen/wvqpZvN?editors=0011|
|許閔翔|https://codepen.io/oupbzfxq-the-scripter/pen/porpBRj?editors=1010|
| YuriT | https://codepen.io/wenfisht/pen/PoKEXjL |
|阿和|https://codepen.io/shnny/pen/gOxoJor?editors=0011|
|phi|https://codepen.io/aiya861202/pen/eYEmVjR|
|Louis|https://codepen.io/Louis164156/pen/KKvZOmp?editors=1010|
| Kelvin Hsu | https://codepen.io/kelvin001/pen/eYEVpZX |
| 乃萱 | https://codepen.io/nainaikuo/pen/QWMQyeE?editors=0011 |
| Steven Chan | https://codepen.io/Steven1220/pen/WNEMrqw?editors=1011 |
| Jie Du | https://codepen.io/qgqonost-the-flexboxer/pen/BadYzNd?editors=0011 |
|張喆|https://codepen.io/wow767t/pen/xxLYOJV|
| Yumyi |https://codepen.io/yunyi12374/pen/ZEJbKVW |
| 黃士桓 | https://codepen.io/shr-huan-huang/pen/ZEJrONE?editors=0011 |
|Hamaji| https://codepen.io/hamajibashi/pen/jOLZryv |
|艾瑞克|https://codepen.io/ericla/pen/XWaZewo?editors=0012|
|林小君| https://codepen.io/hcvbcjqq-the-vuer/pen/eYEVezx | 
| 傅劍軒 | https://codepen.io/seonkuraito/pen/ZEJraRd?editors=0010 |
|Anna|https://codepen.io/kycrleao/pen/YzxeaZG?editors=0011|
|Jasper|https://codepen.io/li-jasper/pen/zYdRLoQ|
|喜美|https://codepen.io/Candace802/pen/oNeEQjg?editors=0011|
|lingxuan|https://codepen.io/penglingxuan/pen/VwzQVVp?editors=0010|
| Celeste | https://codepen.io/Celeste17/pen/YzxedyE?editors=0011 |
|Vicky Kao|https://codepen.io/vicky03035/pen/abyqMjz|
|Sandy|https://codepen.io/Sandy_L/pen/OJjQYJK?editors=0011|
| 三隻小貓 | https://codepen.io/bagelover/pen/eYEVqeZ?editors=0012 |
|AKI|https://codepen.io/akichen27/pen/OJjvdWK|
|Yashien Lin|https://codepen.io/YashienLin/pen/PoKQxoW?editors=0010|
|kevinhes|https://codepen.io/kevinhes/pen/oNedxMQ?editors=0012|
|danny123|https://codepen.io/binlandz123/pen/rNzvJBL?editors=0010 |
|Irene Wang|https://codepen.io/irene-wang-the-looper/pen/VwzxojK|
|  肉魚  |  https://codepen.io/zoechen13/pen/VwzdKLe  |
|Mingyo|https://codepen.io/Nick-Yo/pen/ExvRNPN?editors=0011 |
|Gui|https://codepen.io/guitimliu/pen/WNEyRJO|
|Booker|https://codepen.io/bookbasketball/pen/NWvzarm|
|柯勝華|https://codepen.io/Chill-Nick/pen/LYjrMKx?editors=0010|
|LTL|https://codepen.io/ltlin93/pen/eYEjVbz|
|zaii|https://codepen.io/ivy2846357/pen/jOLePrp?editors=0010|
|鉦勝|https://codepen.io/atckmax823/pen/vYJVZbv?editors=0011|
|kailun|https://codepen.io/Kailun/pen/dyzgdOG|
|Zooey Cheng|https://codepen.io/noraneko0430/pen/ExvOgJO|
|Alvin|https://codepen.io/Alvin20201116/pen/BadGVop?editors=0011|
|吐司|https://codepen.io/malolulu/pen/VwzgoeM|
|Ching|https://codepen.io/Jaimedede/pen/abyMRPa|
|傑瑞|https://codepen.io/auatwood909815/pen/PoKvpxe?editors=0011|
paul|https://codepen.io/printfootya/pen/yLoWMWm?editors=1010|
|Jean Chiang|https://codepen.io/jeanchiang1221/pen/jOLRzyL|
|Jeff|https://codepen.io/jeff-cheng/pen/XWemGjy|