> 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/125han-shu-jian-gou-zi-3001-300c-new-300d-yu-javascript-de-li-shi/1251han-shu-jian-gou-zi-3001-300c-new-300d-yu-javascript-de-li-shi.md).

# 1.2.5.1.函數建構子、「new」與 JavaScript 的歷史

* function constructor: new
  * 使用new運算子建立物件
* 物件建立的方式
  * 1.[new Object](https://jenhsuan.gitbooks.io/javascript-node-js/content/chapter1/1231wu-jian-yu-300c-dian-300d.html)
  * 2.[object literals](https://jenhsuan.gitbooks.io/javascript-node-js/content/chapter1/1232wu-jian-yu-wu-jian-shi-ti.html)
  * new運算子

```
    //建立物件     
    function Person() {
        this.firstname = 'John';
        this.lastname = 'Doe';
    }

    //建立空物件
    //呼叫person, 並把this指到person上
    var john = new Person();
    //印出Person {firstname: "John", lastname: "Doe"}
    console.log(john)
```
