JavaScript Object Methods

Beginner
6 min read
Updated: Nov 2026
29 guides
Method index

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.

Beginner path.

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:

JavaScript
// 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 items

Build objects, copy properties, and turn lists of pairs into objects.

NameDescriptionTutorial
assign()Copy enumerable own properties from source objects into a target object.Open
create()Create a new object that inherits from a given prototype object.Open
fromEntries()Create an object from an iterable of [key, value] pairs.Open

Keys, Values, and Entries

5 items

List an object’s own keys and values, or walk [key, value] pairs.

NameDescriptionTutorial
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 items

Ask whether a key exists, is enumerable, or comes from the prototype chain.

NameDescriptionTutorial
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 items

Read or set value, writable, enumerable, and configurable flags.

NameDescriptionTutorial
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 items

Stop adding, removing, or changing properties — freeze, seal, and friends.

NameDescriptionTutorial
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 items

Read or set the object that another object inherits from.

NameDescriptionTutorial
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 items

Strict equality helpers and string / primitive conversions.

NameDescriptionTutorial
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

Object is the built-in type for key/value data in JavaScript. Plain objects like { name: "Ada" } store properties. The Object constructor also has static helpers such as Object.keys(), Object.assign(), and Object.freeze().
No. Object is a global in browsers and Node.js. Call Object.keys(obj) or obj.hasOwnProperty("x") anywhere in your JavaScript code.
Static methods are called on Object itself, like Object.keys(obj). Instance methods are called on a value, like obj.toString() or obj.hasOwnProperty("x").
Prefer Object.hasOwn(obj, key) in modern code. It is safer with objects that have a null prototype. hasOwnProperty still works on normal objects.
Open assign(), keys(), values(), entries(), create(), and freeze() first. Then explore descriptors and locking methods like seal() and preventExtensions().

Start with assign()

Open the Object.assign guide—syntax, examples, and FAQs.

assign() tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

12 people found this page helpful