JavaScript Object Methods

About This Index
This page is the JavaScript Object Methods index for the tutorial track. Each row links to a full guide with syntax, simple examples, and FAQs.
The Object API is built into JavaScript — no import needed. Jump to assign(), keys(), entries(), or freeze() when you need a specific method.
Start with assign(), keys(), values(), entries(), create(), and hasOwn() — then open locking methods like freeze() and seal().
How to Call an Object Method
Most Object helpers are static. Call them on Object. A few instance methods run on a value:
// Static methods (call on Object)
Object.assign(target, source);
Object.keys(obj); // ["name", "age"]
Object.values(obj); // ["Ada", 36]
Object.entries(obj); // [["name","Ada"], ...]
Object.freeze(obj);
Object.hasOwn(obj, "name"); // true
// Instance methods (call on a value)
obj.hasOwnProperty("name");
obj.toString(); // "[object Object]" JavaScript Object Methods Table
All Object guides in this JavaScript tutorial series (29 tutorials).
Create and Copy
3 itemsBuild objects, copy properties, and turn lists of pairs into objects.
Keys, Values, and Entries
5 itemsList an object’s own keys and values, or walk [key, value] pairs.
| Name | Description | Tutorial |
|---|---|---|
keys() | Returns an array of the object’s own enumerable string property names. | Open |
values() | Returns an array of the object’s own enumerable string-keyed values. | Open |
entries() | Return an array of an object's own enumerable [key, value] pairs. | Open |
fromEntries() | Create an object from an iterable of [key, value] pairs. | Open |
groupBy() | Group iterable items into a plain object keyed by a callback’s return value. | Open |
Check Properties
4 itemsAsk whether a key exists, is enumerable, or comes from the prototype chain.
| Name | Description | Tutorial |
|---|---|---|
hasOwn() | Return true if the object has an own property with the given key. | Open |
hasOwnProperty() | Returns true if the property exists as an own property on the object. | Open |
propertyIsEnumerable() | Returns true if the named own property is enumerable. | Open |
isPrototypeOf() | Returns true if this object appears in another object’s prototype chain. | Open |
Property Descriptors
6 itemsRead or set value, writable, enumerable, and configurable flags.
| Name | Description | Tutorial |
|---|---|---|
defineProperty() | Define or update a single property on an object using a property descriptor. | Open |
defineProperties() | Add or update multiple properties on an object using property descriptors. | Open |
getOwnPropertyDescriptor() | Return the property descriptor for one own property on an object. | Open |
getOwnPropertyDescriptors() | Return an object mapping each own property name or symbol to its full descriptor. | Open |
getOwnPropertyNames() | Return an array of all own string property names, including non-enumerable ones. | Open |
getOwnPropertySymbols() | Return an array of all own symbol property keys on an object. | Open |
Lock Objects Down
6 itemsStop adding, removing, or changing properties — freeze, seal, and friends.
| Name | Description | Tutorial |
|---|---|---|
freeze() | Freeze an object so you cannot add, remove, or change its properties. | Open |
seal() | Prevents adding or removing properties; writable values can still change. | Open |
preventExtensions() | Marks an object so no new own properties can be added. | Open |
isFrozen() | Returns true if the object cannot add, remove, or change properties. | Open |
isSealed() | Returns true if you cannot add or remove properties (values may still change). | Open |
isExtensible() | Return true if new own properties can be added to the object. | Open |
Prototype Links
4 itemsRead or set the object that another object inherits from.
| Name | Description | Tutorial |
|---|---|---|
getPrototypeOf() | Return the prototype of an object, or null if it has none. | Open |
setPrototypeOf() | Sets the prototype (internal [[Prototype]]) of an object. | Open |
isPrototypeOf() | Returns true if this object appears in another object’s prototype chain. | Open |
create() | Create a new object that inherits from a given prototype object. | Open |
Compare and Convert
4 itemsStrict equality helpers and string / primitive conversions.
| Name | Description | Tutorial |
|---|---|---|
is() | Compare two values like ===, except NaN equals NaN and +0 differs from -0. | Open |
toString() | Returns a string representation of the object (default "[object Object]"). | Open |
toLocaleString() | Returns a locale-sensitive string representation of the object. | Open |
valueOf() | Returns the primitive value of the object (often the object itself for plain objects). | Open |
Frequently Asked Questions
Start with assign()
Open the Object.assign guide—syntax, examples, and FAQs.
12 people found this page helpful
