> For the complete documentation index, see [llms.txt](https://jen-hsuan-hsieh.gitbook.io/javascript-node-js/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jen-hsuan-hsieh.gitbook.io/javascript-node-js/chapter1/12javascript-quan-gong-lve-ff1a-ke-fu-js-de-qi-guai-bu-fen/121zhi-xing-huan-jing-yu-ci-hui-huan-jing/1214zhi-xing-huan-jing-ff1a-cheng-shi-zhi-xing.md).

# 1.2.1.4.執行環境：程式執行

* 對Code進行逐步編譯, 執行
* 執行下面程式碼會看到
  * Called b!
  * undefined
  * Hello World!
* 解析
  * 建立階段
    * 將函式存在記憶體: 行1 \~ 3
    * 將變數存在記憶體, 但還未設定值: 行9
  * 執行階段
    * 執行行9, 設定a
    * 執行行5, 7, 11

```
1 function b() {
2    console.log('Called b!');
3 }
4
5 b();
6
7 console.log(a);
8
9 var a = 'Hello World!';
10
11 console.log(a);
```
