---
# System prepended metadata

title: "\U0001F3C5 Day 12 - 程式錯誤發現"
tags: [JS 直播班 - 2023 秋季班]

---

---
tags: Vue 直播班 - 2023 冬季班
---
# 🏅 Day 12 - 程式錯誤發現


參考文章：https://wcc723.github.io/development/2020/09/20/js-semi/

題目
---
1. 請修正以下程式碼錯誤，並執行 console.log
2. 請嘗試說明以下程式碼錯誤的原因

```js=
let saySomething = '小姐一個人嗎 :D'
(function() {
  console.log(saySomething);
})
```


## 回報流程

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

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

<!-- 解答：  
1. 應該更正為: 
let saySomething = '小姐一個人嗎 :D'
;(function() {
  console.log(saySomething);
})()

2.
a. 使用立即函式需要在結尾的部分加入一組 () 才會正確執行。
b. 由於題目的 JS 程式碼在運行時會被視為同一行，如下: 

let saySomething = '小姐一個人嗎 :D'(function() {console.log(saySomething);})

如果要避免此錯誤就需要使用分號將其隔開。 
-->




回報區
---


|     Discord      |                                                             CodePen / 答案                                                             |
|:----------------:|:--------------------------------------------------------------------------------------------------------------------------------------:|
| bf_tsai | [CodePen](https://codepen.io/BF-Tsai/pen/QWojOKp?editors=1111) |
| Tippy | [CodePen](https://codepen.io/Ektodor-Wang/pen/vYPNWGq) |
| kj | [CodePen](https://codepen.io/Eero-Chiao/pen/oNVjoBO) |
| py | [CodePen](https://codepen.io/Wpypy/pen/bGZVYWB?editors=1011) |
| Yijing | [CodePen](https://codepen.io/Yi-Jing-71080635/pen/abMvVWR?editors=0010) |
| pingshian | [CodePen](https://codepen.io/pingshian0131/pen/NWJGwvp?editors=0012) |
| ryan.chou | [CodePen](https://codepen.io/csw8524/pen/JjzYOLV) |
| Fabio20 | [CodePen](https://codepen.io/fabio7621/pen/NWJGwLv?editors=1112) |
| Moreene | [CodePen](https://codepen.io/Moreene/pen/eYXpeLL) |
| Emily | [CodePen](https://codepen.io/Emily2089/pen/oNVjodK) |
| 精靈 | [CodePen](https://codepen.io/justafairy/pen/QWojOXQ) |
| Chia Pin | [CodePen](https://codepen.io/joker-cat/pen/xxBwPvv) |
| cest_jessie | [CodePen](https://codepen.io/itsjessiechen/pen/xxBwNwg) |
| KUN. | [CodePen](https://codepen.io/barry91205/pen/KKEdZpB?editors=1111) |
| PoRay | [CodePen](https://codepen.io/raycheng/pen/BaboJQJ?editors=1111) |
| 風羽 | [CodePen](https://codepen.io/Joy-Huang/pen/mdoeqRd?editors=1011) |
| Hedy | [CodePen](https://codepen.io/pen/?editors=0012) |
| Uli | [CodePen](https://codepen.io/uli1313/pen/RwdWxyL?editors=1011) |
|  依依 | [CodePen](https://codepen.io/Rita-Yang/pen/bGZVayO?editors=1011) |
|  Charlotte Lee | [CodePen](https://codepen.io/char849/pen/zYbvpgB) |
| Tom | [CodePen](https://codepen.io/sp1daTomm/pen/dyrYdYZ) |
| XinYu | [CodePen](https://codepen.io/HsuXinYu/pen/WNmQdqm?editors=0012) |
| Yuetin | [CodePen](https://codepen.io/Yue9527/pen/wvOKyBN?editors=1111) |
| Leo | [CodePen](https://codepen.io/Aruminiya/pen/yLwYvVY) |
| Nelly | [CodePen](https://codepen.io/Nelly-Guo/pen/ExMVQbX?editors=0011) |
| SHUO | [CodePen](https://codepen.io/xrzarxkl-the-reactor/pen/oNVjEyy) |
| Winnie | [CodePen](https://codepen.io/codepen-io-winnie/pen/gOEavXq?editors=0011) |
| Yang | [CodePen](https://codepen.io/Yang-J/pen/VwRvQxG?editors=0011) |
| Celine 510 | [CodePen](https://codepen.io/Celine-510/pen/Yzgyegd) |
| stone4584 | [CodePen](https://codepen.io/Royen0506/pen/GRepxmJ?editors=1111) |
| kawa | [CodePen](https://codepen.io/z83xji6/pen/jOJbzww?editors=1011) |
| dora | [CodePen](https://codepen.io/dorayu/pen/LYapbog?editors=1011) |
| RayRay | [CodePen](https://codepen.io/CityRay/pen/QWojmoa) |
| celinelinnn |[CodePen](https://codepen.io/celinephoebe/pen/eYXpyjO)|
| Enzo | [CodePen](https://codepen.io/Enzo-Lo/pen/KKEdRWG?editors=1111) |
| Ataraxia | [CodePen](https://codepen.io/ataraxia8888/pen/bGZVMeL) |
| Neil | [CodePen](https://codepen.io/Neil1024/pen/YzgyLjQ?editors=0012) |
| MikeLin | [CodePen](https://codepen.io/MikeLin0701/pen/NWJGzgQ) |
| yu.t_liu | [CodePen](https://codepen.io/YuT200053/pen/jOJbKpW?editors=1111) |
| Antonio | [CodePen](https://codepen.io/gwhvusel-the-builder/pen/jOJbKor) |
| Eazy | [CodePen](https://codepen.io/Eazychen/pen/poYjKMR?editors=1111) |
| Ariel | [CodePen](https://codepen.io/ariel0510/pen/abMvjdK) |
| ann6212 | [CodePen](https://codepen.io/yqmegupa-the-styleful/pen/bGZVjrB?editors=1112) |
| 熊大 | [CodePen](https://codepen.io/asiating/pen/bGZVjMq) |
| MY | [CodePen](https://codepen.io/ahmomoz/pen/JjzYBjB?editors=1011) |
|smalljie|[CodePen](https://codepen.io/smalljie/pen/yLwYqQj)|
|Wei_Rio|[CodePen](https://codepen.io/wei_wu/pen/YzgyOKw?editors=0011)|
| elena | [CodePen](https://codepen.io/elena0127abc/pen/bGZVxoM) |
|FangFang|[CodePen](https://codepen.io/FangFang09/pen/mdoeGpM)|
| Chris | [CodePen](https://codepen.io/cjtseng07/pen/QWojVoo) |
| nini1202desu | [CodePen](https://codepen.io/tvxq5206/pen/MWxaqxg?editors=1012) |
| Iris | [CodePen](https://codepen.io/iris831206/pen/LYapMNV?editors=1111) |
| .zack_p| [CodePen](https://codepen.io/Designer-PH/pen/qBvOwjO?editors=1111) |
| fanshu0303 | [CodePen](https://codepen.io/JuiHsuanLee0303/pen/Baboxzm) |
| 保羅 | [CodePen](https://codepen.io/paul-1997/pen/eYXpaYN?editors=0011) |
|　Nielsen | [Codepen](https://codepen.io/nielsen_dch/pen/OJqyYmd)|
 |　小夏 | [Codepen](https://codepen.io/michaelhsia/pen/yLwYmaR)|
 | chihyang | [CodePen](https://codepen.io/hike1707/pen/gOEPbxx) |
  | macihuang | [CodePen](https://codepen.io/macy1215/pen/oNVjONg) |
   | PoWei#8484 | [CodePen]( https://codepen.io/harrison-wei-lai/pen/eYXJveo?editors=1010) |
   | ⭐️小正 | [CodePen]( https://codepen.io/colorgolden/pen/ZEPQeMN?editors=1111) |
   | _amaaaa | [CodePen](https://codepen.io/Alicia-Chu/pen/poYgPjX) |
| haru | [CodePen](https://codepen.io/haru_portfoilo/pen/wvOMdPO?editors=0011) |
| sponge | [CodePen](https://codepen.io/biunpujm-the-flexboxer/pen/MWxKOqr?editors=1111) |
| Rock | [CodePen](https://codepen.io/xiu43317/pen/zYbraRo) |
| Peng | [CodePen](https://codepen.io/H-Peng/pen/LYaGXzX?editors=1011) |
| Jason | [CodePen](https://codepen.io/bfnrjakt/pen/LYaGMVw) |
| PayRoom |[CodePen](https://codepen.io/water38198/pen/yLweGXx)|
| carrie | [CodePen](https://codepen.io/echocarriet/pen/zYbryJg)|
| jeremyChan | [CodePen](https://codepen.io/nudieisgood/pen/poYgGdz?editors=1112) |
| jia yu | [CodePen](https://codepen.io/fjqxaznl-the-reactor/pen/LYaNZVd?editors=1011) |
| WEI | [CodePen](https://codepen.io/wei-z/pen/LYaNRjP) |
| MDFK | [CodePen](https://codepen.io/maywang/pen/wvOMqvd?editors=0012) |
| skypassion5000 | [CodePen](https://codepen.io/skypassion5000/pen/ExMKwXP?editors=0011) |
| JING | [CodePen](https://codepen.io/HSUANIN0327/pen/vYPGeZe) |
|yuling|[Codepen](https://codepen.io/igzdflpu/pen/abMNMPG)|
|  cbs  |[Codepen](https://codepen.io/wasdjk/pen/dyrXojR?editors=1111)|
| 狸貓 | [CodePen](https://codepen.io/tanuki320/pen/rNRMNgw?editors=1111) |
| Vivian2857 | [CodePen](https://codepen.io/vivian_lin/pen/ZEPpWqd?editors=1011) |
| runweiting | [CodePen](https://codepen.io/weiting14/pen/ZEPpKVd) |
| hua | [CodePen](https://codepen.io/LHua/pen/oNVzRKY?editors=1111) |
| xuan | [CodePen](https://codepen.io/xuan0915/pen/GReqgpg?editors=0011) |
| 黃士桓 | [codePen](https://codepen.io/shr-huan-huang/pen/yLwgYaZ) |
| Jim | [codePen](https://codepen.io/asiahedh-the-encoder/pen/zYbNJGK?editors=0110) |
| 辣椒 | [Codepen](https://codepen.io/chilichen118/pen/bGZgzdE) |
| shuuu | [Codepen](https://codepen.io/jybvfzos-the-bashful/pen/XWGpOqP?editors=1011) |
| 翔.Ben | [Codepen](https://codepen.io/energy95272z/pen/GRemaZP?editors=0011) |
| 關關 | [Codepen](https://codepen.io/ashkuan/pen/GReyWVq) |
| Ting | [CodePen](https://codepen.io/liara/pen/qBvKrNa) |
| WA | [CodePen](https://codepen.io/ldddl/pen/mdoYwWE) |
| yuan! | [CodePen](https://codepen.io/townyuan/pen/oNOjLEZ) |


<!-- 

|  | [CodePen]() |
 
-->
