---
# System prepended metadata

title: "\U0001F3C5 Day 12 - 程式錯誤發現"
tags: [Vue 直播班 - 2022 冬季班]

---

---
tags: Vue 直播班 - 2022 冬季班
---
# 🏅 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 / 答案                                                             |
|:----------------:|:--------------------------------------------------------------------------------------------------------------------------------------:|
|   Wendy3#5615    |                                           [Codepen](https://codepen.io/wendy03/pen/VwBeZPP)                                            |
|    Tami#6742     |                                      [Codepen](https://codepen.io/wqsdqbjn-the-vuer/pen/xxJZKqZ)                                       |
|    冬天#5215     |                                           [Codepen](https://codepen.io/winter_/pen/NWBxKpL)                                            |
|   KC_8685#9343   |                                          [Codepen](https://codepen.io/cathy7411/pen/RwBrbKg)                                           |
|   ChloeLo#4858   |                                           [Codepen](https://codepen.io/chloelo/pen/zYLrOZx)                                            |
|    大頭#8116     |                                    [Codepen](https://codepen.io/d22495521/pen/XWBXraJ?editors=1012)                                    |
|    Fang#4680     |                                           [Codepen](https://codepen.io/std95174/pen/dyjGbzv)                                           |
|    薯餅#3581     |                                        [Codepen](https://codepen.io/ColdingPoTaTo/pen/jOpWNGd)                                         |
|    yuyu#6310     |                                    [Codepen](https://codepen.io/yuyu0905/pen/WNKreZY?editors=0012)                                     |
|  LinaChen#1796   |                                           [Codepen](https://codepen.io/LinaChen/pen/poZgzrB)                                           |
|      popeye      |                                          [codepen](https://codepen.io/popeye_ux/pen/PoBZYOR)                                           |
|  kenki100#0068   |                                            [Codepen](https://codepen.io/ken100/pen/zYLrOPG)                                            |
|     Chi#7605     |                                           [Codepen](https://codepen.io/YoChi84/pen/xxJZKYO)                                            |
|    kuku#3118     |                                         [Codepen](https://codepen.io/mengting-ku/pen/OJwMLQE)                                          |
|   AuroraC#6539   |                                     [codepen](https://codepen.io/AuroraC/pen/mdjVbBq?editors=1012)                                     |
|    ㄚ翔#8126     |                                 [codepen](https://codepen.io/engineerjohnson/pen/qBybWYR?editors=1111)                                 |
|      bakiii      |                                            [codepen](https://codepen.io/aki168/pen/KKBwazq)                                            |
|    無名#6427     |                                           [codepen](https://codepen.io/Nomoney/pen/GRBpxMa)                                            |
|  hannahTW#2224   |                                    [codepen](https://codepen.io/hangineer/pen/MWBKgGg?editors=0011)                                    |
|    米米#1824     |                                  [codepen](https://codepen.io/Jameshsu0407/pen/QWByLro?editors=0011)                                   |
|   Benson#6763    |                                           [CodePen](https://codepen.io/kumashow/pen/YzjwKvr)                                           |
|    大衛#4869     |                                    [CodePen](https://codepen.io/exnsrpjc/pen/BaPjBVO?editors=0011)                                     |
|    Cliff#4606    |                                    [Codepen](https://codepen.io/Cliff_hex/pen/vYaLBQp?editors=1011)                                    |
|    泊岸#3466     |                                   [Codepen](https://codepen.io/qoq77416416/pen/mdjVbgK?editors=1011)                                   |
|    Alex#9978     |                              [Codepen](https://codepen.io/datsxzqg-the-selector/pen/ZEjQzNb?editors=0011)                              |
|    ABOOS#6276    |                                    [Codepen](https://codepen.io/guhungyin/pen/zYLrOVK?editors=1112)                                    |
|    JackC#0411    |                                           [CodePen](https://codepen.io/key0329/pen/YzjwzKa)                                            |
|  mandylai#4055   |                                   [CodePen](https://codepen.io/mandy-lai-2/pen/xxJZxxd?editors=0012)                                   |
|    albee#9121    |                                         [Codepen](https://codepen.io/albee-chang/pen/oNMbNgp)                                          |
|    Kimi#9564     |                                           [CodePen](https://codepen.io/kimihu91/pen/xxJwjGm)                                           |
|  LHchien33#6232  |                                          [CodePen](https://codepen.io/lin_chien/pen/oNMbNNo)                                           |
|    Rena#6249     |                                         [Codepen](https://codepen.io/aureate0116/pen/eYjJYmz)                                          |
|    RainJ#3480    |                                    [Codepen](https://codepen.io/RainJCode/pen/JjBGjdy?editors=1111)                                    |
|     YC#2522      |                                             [CodePen](https://codepen.io/YCLu/pen/oNMjqYy)                                             |
|     威0#6919     |                                   [codepen](https://codepen.io/n0918679182/pen/xxJZxVL?editors=0012)                                   |
|    Hilda#7085    |                                      [codepen](https://codepen.io/vwquikad-the-vuer/pen/VwBewax)                                       |
|    艸良#2846     |                                  [codepen](https://codepen.io/momoninainai/pen/VwBewPd?editors=1111)                                   |
|    威爾#1694     |                                           [CodePen](https://codepen.io/WILL_Wu/pen/MWBKWmj)                                            |
|   Winnie#1306    |                                 [Codepen](https://codepen.io/WinnieWuWinnie/pen/vYaLYmV?editors=0012)                                  |
|  christina#6185  |                                          [Codepen](https://codepen.io/chrisc0210/pen/zYLrYzz)                                          |
|    小夜#3809     |                                     [Codepen](https://codepen.io/Naito_K/pen/wvxMvpw?editors=0111)                                     |
| PeihanWang#2530  |                                   [Codepen](https://codepen.io/PeihanWang/pen/zYLrYpE?editors=0012)                                    |
|   心幻羽#0056    |                                   [Codepen](https://codepen.io/linglingsyu/pen/QWByWxN?editors=1111)                                   |
|  Ruby Chen#7452  |                                    [CodePen](https://codepen.io/ruby92429/pen/NWBxWzG?editors=1011)                                    |
|   魚子醬#5220    |                                           [CodePen](https://codepen.io/haihsuan/pen/YzjwzJB)                                           |
|     int#7518     |                                    [Codepen](https://codepen.io/intHuang/pen/ExpPxOQ?editors=0011)                                     |
|    柚子#3958     |                                    [Codepen](https://codepen.io/as6625998/pen/GRBoRaK?editors=1011)                                    |
|   Cheryl#4007    |                                   [Codepen](https://codepen.io/Cheryl-Hsu/pen/yLqeLWX?editors=0012)                                    |
|  jimmyFang#9575  |                                    [Codepen](https://codepen.io/pohxiqqo/pen/poZgoMP?editors=1011)                                     |
|    yaru#6308     |                                    [CodePen](https://codepen.io/lszaietc/pen/qBybBVo?editors=1011)                                     |
|  Jill Lee#0809   |                                  [CodePen](https://codepen.io/chi-ling-lee/pen/vYaLEXB?editors=1010)                                   |
|    柔柔#1716     |                                     [Codepen](https://codepen.io/rouchen/pen/jOpWEBL?editors=1011)                                     |
|   楊苡安#2752    |                                           [hackmd](https://hackmd.io/1lZoskdERWuuqma1l--QQw)                                           |
|  Asher Xu#9297   |                                          [Codepen](https://codepen.io/kirakira72/pen/BaPjyRQ)                                          |
|     How#5806     |                                         [Codepen](https://codepen.io/howtobefine/pen/gOjPbzw)                                          |
|   Yishan#4902    |                              [Codepen](https://codepen.io/gdjrehhw-the-animator/pen/NWBxPwg?editors=0010)                              |
|   Wendy77#8049   |                                           [Codepen](https://codepen.io/Wendy__/pen/xxJZbWe)                                            |
|     PH#2731      |                                    [Codepen](https://codepen.io/lokf9527/pen/ZEjQYjM?editors=1111)                                     |
|  Potatolee#7749  |                                   [Codepen](https://codepen.io/potatoleee/pen/QWBybrY?editors=1011)                                    |
|   黑白兔＃0684   |                                          [Codepen](https://codepen.io/johnny329/pen/vYaLOqR)                                           |
|    RJRS#9430     |                                             [CodePen](https://codepen.io/RJRS/pen/NWBxGPV)                                             |
|  masterYan#2480  |                               [CodePen](https://codepen.io/htzwgoqt-the-looper/pen/MWBKaey?editors=1111)                               |
|   小木馬#8760    |                                           [CodePen](https://codepen.io/wmmtbcsd/pen/QWByjdw)                                           |
|   CatBoxy#4207   |                                           [CodePen](https://codepen.io/nekoboxy/pen/dyjGyPd)                                           |
|    竹輪#3335     |                                         [CodePen](https://codepen.io/chikuwa0120/pen/bGjEVLG)                                          |
| 出事了阿伯#9923  |                                   [CodePen](https://codepen.io/BradpittLai/pen/xxJZwaW?editors=1011)                                   |
|     JY#5712      |                                           [CodePen](https://codepen.io/judy_123/pen/bGjEbrx)                                           |
| jacky010080#0880 |                                        [CodePen](https://codepen.io/Yen-Jung-Chen/pen/GRBopLV)                                         |
|    阿榮#8277     |                                     [CodePen](https://codepen.io/mogzbvfl-the-reactor/pen/rNrxazZ)                                     |
|    Sean#3825     |                                    [CodePen](https://codepen.io/sean_1215/pen/NWBxKgL?editors=1011)                                    |
|    阿鑫#4346     |                                    [CodePen](https://codepen.io/Neil1024/pen/eYjJZBw?editors=0011)                                     |
|   Amberhh#2465   |                                           [codepen](https://codepen.io/Amberhh/pen/KKBVPvE)                                            |
|    azami#5986    |                                            [CodePen](https://codepen.io/azami/pen/LYBGNOb)                                             |
|  老皮博士#8050   |                                     [CodePen](https://codepen.io/li0406/pen/ExpPKeK?editors=0011)                                      |
|    eason#7884    |                                      [CodePen](https://codepen.io/ASLEO/pen/XWBXdyX?editors=1111)                                      |
|   Austyn#0949    |                                    [CodePen](https://codepen.io/fish90547/pen/JjBGKKr?editors=0012)                                    |
|  Judy Wei#6103   |                                           [CodePen](https://codepen.io/Judy0718/pen/PoBZzjg)                                           |
|    圈圈#4060     |                                [Codepen](https://codepen.io/wjejfczn-the-bold/pen/qBybNpo?editors=0011)                                |
|   SASIMI#5099    |                                         [Codepen](https://codepen.io/sashimi1327/pen/WNKrGpj)                                          |
|   Bella_#1587    |                                          [Codepen](https://codepen.io/Chen-Bella/pen/rNrxMJZ)                                          |
|  DIO大人_#4776   |                                          [Codepen](https://codepen.io/oscar-2283/pen/KKBVgbR)                                          |
|   Fannie#7800    |                                      [Codepen](https://codepen.io/dgltu/pen/OJwMbXO?editors=1111)                                      |
|  enolachen#8031  | [Codepen](https://codepen.io/Chen-Enola/pen/xxJZRpVhttps://codepen.io/Chen-Enola/pen/xxJZRpVhttps://codepen.io/Chen-Enola/pen/xxJZRpV) |
|   Mia小福#4473   |                                    [Codepen](https://codepen.io/a0950271/pen/PoBZbRR?editors=1111)                                     |
|     xin#1214     |                                           [Codepen](https://codepen.io/SiaoYao/pen/eYjJgNZ)                                            |
| yoyo123456#0577  |                                    [Codepen](https://codepen.io/hungyoyo/pen/dyjGNPJ?editors=0011)                                     |
|  suihsilan#9485  |                                    [Codepen](https://codepen.io/suihsilan/pen/PoBZOoy?editors=0010)                                    |
|    yoyo#1003     |                                               [Codepen](https://codepen.io/pen/QWByOpW)                                                |
|     RT#2151      |                                   [Codepen](https://codepen.io/youtingluo/pen/xxJZPrX?editors=0011)                                    |
|  Hironaka#7367   |                                  [Codepen](https://codepen.io/Hironaka0815/pen/JjBGOOM?editors=0010)                                   |
|    RyanC#6960    |                                     [Codepen](https://codepen.io/RyanYD/pen/gOjPXjJ?editors=0011)                                      |
|   AkiHico#9239   |                                     [Codepen](https://codepen.io/akihico/pen/MWBKrxB?editors=1011)                                     |
|    阿沁#8176     |                                           [Codepen](https://codepen.io/a8322342/pen/jOpWzmE)                                           |
|   Eileen#6454    |                                        [  Codepen  ](https://codepen.io/Eileen-io/pen/NWBxMEv)                                         |
|   FiReBrO#0557   |                                        [  Codepen  ](https://codepen.io/firebro42/pen/rNrxKLb)                                         |
|   hungya#0773    |                                  [  Codepen  ](https://codepen.io/hungya777/pen/gOjPBPW?editors=1011)                                  |
|  Silvialu#4521   |                                       [  Codepen  ](https://codepen.io/Silvia091640/pen/OJwMRxR)                                       |
| Knock59487#9114  |                                   [  Codepen  ](https://codepen.io/Zack88/pen/XWBXyoa?editors=1111)                                    |
Zack_P#1805|[  Codepen  ](https://codepen.io/tmzazirh-the-animator/pen/ZEjQVYJ?editors=1111)|
| sherlin#4587    | [CodePen](https://codepen.io/sherlinKuo/pen/zYLreXr?editors=1111)           |
| Mylène#2481     | [CodePen](https://codepen.io/hamajibashi/pen/bGjEZXd)                       |
| Hazel.#6020     | [CodePen](https://codepen.io/Hazelhsieh/pen/WNKrZXa?editors=1012)           |
| Paul#7426       | [CodePen](https://codepen.io/paul-1997/pen/QWBNNNm?editors=0011)            |
| kevin#6131      | [CodePen](https://codepen.io/xlqjezvc-the-encoder/pen/XWBdKOg?editors=1011) |
| Bassjim#0118    | [CodePen](https://codepen.io/unrtxbaq/pen/yLqOJra?editors=1111)             |
| shiuan#4721     | [CodePen](https://codepen.io/prankaChang/pen/dyjMqBx?editors=0010)          |
| Ron Liang#7277  | [CodePen](https://codepen.io/ron-go/pen/xxJVBGV)                            |
| hsufengs#2816   | [CodePen](https://codepen.io/feng-sheng-hsu/pen/MWBewYV?editors=0010)       |
| PayRoom#8328    | [CodePen](https://codepen.io/water38198/pen/LYBZVBp)                        |
| sophiee#7015    | [codepen](https://codepen.io/sophiee2727/pen/QWBEKrK?editors=1011)          |
| Yuna Huang#2692 | [CodePen](https://codepen.io/Yuna1002/pen/poZbwjY?editors=0011)             |
| Cream #3449     | [CodePen](https://codepen.io/frxdwbbi-the-sasster/pen/WNKGNKP?editors=1012) |
| 阿異#4776       | [CodePen](https://codepen.io/yani21399/pen/RwBGgzM)                         |
|GOD_QWERTYUIOPLKJLKLLOINJ_MASTER#4922| [CodePen](https://codepen.io/sho666/pen/ExpgRWe?editors=1012)             |
|Wei#2330|[Codepen](https://codepen.io/ixfjxrbo-the-typescripter/pen/zYLowMm)|
|YI#0863|[Codepen](https://codepen.io/YI0305/pen/GRBNEZN?editors=0012)|
|阿蘇#8531|[Codepen](https://codepen.io/susu3131/pen/eYjBjeX?editors=0011)|
|Shuo#1596|[Codepen](https://codepen.io/chiangchungshuo/pen/LYBxZoN)|
|popcorn_3q#9893|[Codepen](https://codepen.io/arnyrpqt-the-sasster/pen/KKBayaZ?editors=1011)|
| Jenny真#7532 | [CodePen](https://codepen.io/wei-chen-wu/pen/poZRZZZ?editors=0011) |
|IreneY#0086|[CodePen](https://codepen.io/HalfPlannedJourney/pen/poZeRLa)|
|MengLin#3001|[CodePen](https://codepen.io/aacj2642/pen/YzjZVJd)|
|Yiru#0236|[Codepen](https://codepen.io/yiru94/pen/ZEjeyxR)|
|   YU#0618   | [Codepen](https://codepen.io/yoken_/pen/xxJrRPR)        |
|   Cookie SSS#6991   | [Codepen](https://codepen.io/sqhjikpa-the-selector/pen/BaPwwWw?editors=1010)        |
|Tuhacrt#0008|[codepen](https://codepen.io/Tuhacrt/pen/rNrderJ?editors=0011)|
|周周#3503|[codepen](https://codepen.io/jhoujhou-the-decoder/pen/rNrKPby?editors=0010)|
|Jujubeleven#1036|[Codepen](https://codepen.io/jujubeleven/pen/jOpQEbW?editors=0011)|
|  cbs#9007  |[Codepen](https://codepen.io/wasdjk/pen/QWVgaaR)|
