> For the complete documentation index, see [llms.txt](https://lochiwei.gitbook.io/web/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lochiwei.gitbook.io/web/js/val/obj/create.md).

# creating objects

[JS](/web/js.md) ⟩ [value](/web/js/val.md) ⟩ [object](/web/js/val/obj.md) ⟩ create

{% hint style="success" %}
objects can be created with&#x20;

* :star\_of\_david: [object literal](/web/js/val/obj/create/obj.md)
* :heavy\_plus\_sign: [new](/web/js/val/obj/create/new.md) operator&#x20;
* :m: [Object.create()](/web/js/val/obj/create/object.create.md)

```javascript
// ⭐️ creating objects with different prototypes
{name: value}         // object's prototype === Object.prototype
new F()               // object's prototype === F.prototype
Object.create(proto)  // object's prototype === proto
```

{% endhint %}

{% tabs %}
{% tab title="🔴 主題" %}

* [object literal](/web/js/val/obj/create/obj.md) / [array literal](/web/js/val/builtin/arr/create/arr.md)
* ["pure" object](/web/js/val/obj/create/object.create/pure-object.md)
* [closure as object](/web/js/val/func/closure/examples/closure-as-object.md) - closure can be used as an object.
  {% endtab %}

{% tab title="📗 參考" %}

* [ ] [JavaScript: The Definitive Guide](/web/master/ref/javascript-the-definitive-guide.md) ⟩ 6.2 Creating Objects
  {% endtab %}

{% tab title="📘 手冊" %}

* [Object.create()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create)
  {% endtab %}
  {% endtabs %}
