On this page
  1. Object.create
  2. Signature & Overview
  3. Notes & Pitfalls
  4. Example

Object.create

Prev: assign | Up: Object | Next: freeze
Rel: Object, Object & Reflect Guide
Ref: MDN Web Docs — Object.create
Tags: #public #web #javascript #builtins #object #tier/standard


Signature & Overview

Object.create(proto, propertiesObject?)

Creates a new object with the specified prototype (Object.create(null) creates a dictionary with no prototype).

Notes & Pitfalls

Example

const dict = Object.create(null);
dict.toString = "safe value";
console.assert(Object.getPrototypeOf(dict) === null);

Linked from

Related notes