Skip to content
Related Articles

Related Articles

JavaScript Object Complete Reference

Improve Article
Save Article
  • Last Updated : 23 Nov, 2022
Improve Article
Save Article

JavaScript Objects are the most important data type and form the building blocks for modern JavaScript. The “Object” class represents the JavaScript data types. Objects are quite different from JavaScript’s primitive data types (Number, String, Boolean, null, undefined, and symbol). It is used to store different types of key collections and complex entities. It can be created by using the Object() method or by using object initializer/literal syntax.

Syntax:

objectName.methodName()

Example:  Using function definition as property value and accessing with additional details. 

HTML




<p id="gfg"></p>
<script>
    // Object creation
    var student = {
    name: "Martin",
    class : "12th",
    section : "A",
     
    studentDetails : function() {
        return this.name + " " + this.class
            + " " + this.section + " ";
    }
        };
         
        // Display object data
        document.getElementById("gfg").innerHTML
    = "STUDENT " + student.studentDetails();
</script>

Output:

STUDENT Martin 12th A

The complete list of JavaScript Object is listed below:

Static Methods:

JavaScript Object Static Methods

Description

JavaScript Object.assign() MethodAmong the Object constructor methods, there is a method Object.assign() which is used to copy the values and properties from one or more source objects to a target object.
JavaScript Object.create() Methodwe already know the importance of classes and objects but unlike other programming languages, JavaScript does not have the traditional classes as seen in other languages. 
JavaScript Object.defineProperty() MethodThe Object.defineProperty() method in JavaScript is a Standard built-in object which defines a new property directly on an object and returns the object.
JavaScript Object.defineProperties() MethodThe Object.defineProperties() method in JavaScript is Standard built-in Object that definesobject a new or modifies existing properties directly on an object and it returns the object.
JavaScript Object.entries() MethodObject.entries() Method Object.entries() method is used to return an array consisting of enumerable property [key, value] pairs of the object which are passed as the parameter.
JavaScript Object.freeze() MethodObject.freeze() Method: Among the Object constructor methods, there is a method Object.freeze() which is used to freeze an object.
JavaScript Object.fromEntries() MethodThe Object.fromEntries() method in JavaScript is a standard built-in object which is used to transform a list of key-value pairs into an object. 
JavaScript Object.getOwnPropertyDescriptor() MethodThe Object.getOwnPropertyDescriptor() method in JavaScript is a standard built-in object that returns a property descriptor for own property of a given object.
JavaScript Object.getOwnPropertyNames() MethodThe Object.getOwnPropertyNames() method in JavaScript is a standard built-in object which returns all properties that are present in a given object.
JavaScript Object.getOwnPropertySymbols() MethodThe Object.getOwnPropertySymbols() method in JavaScript is a standard built-in object which returns an array of all symbol properties that are present in a given object.
JavaScript Object.getPrototypeOf() MethodThe getPrototypeOf() is an inbuilt function in JavaScript that is used to check the prototype of an object that the user has created.
JavaScript Object.is() MethodObject.is() method is used to determine whether two values are the same or not. 
JavaScript Object.isExtensible() MethodThe Object.preventExtensions() method in JavaScript is a standard built-in object which checks whether an object is extensible or not.
JavaScript Object.isFrozen( ) MethodObject.isFrozen() which is used to determine if an object is frozen or not. 
JavaScript Object.isSealed( ) MethodObject.isSealed() method is used to determine if an object is sealed or not.
JavaScript Object.keys() MethodThe Object.keys() method is used to return an array whose elements are strings corresponding to the enumerable properties found directly upon an object. 
JavaScript Object.preventExtensions() MethodThe Object.preventExtensions() method in JavaScript is standard built-in objects which prevents new properties from ever being added to an object.
JavaScript object.seal() MethodAmong the Object constructor methods, there is a method Object.seal() which is used to seal an object.
JavaScript Object.setPrototypeOf() MethodThe Object.setPrototypeOf() method in JavaScript is standard built-in objects which sets the prototype (i.e., the internal [[Prototype]] property) of a specified object to another object or null.
JavaScript Object.values() MethodObject.values() method is used to return an array whose elements are the enumerable property values found on the object.

Instance Properties:

JavaScript Object Instance Properties

Description 

JavaScript Object.prototype.constructor PropertyThe constructor property returns a reference to the object constructor function that has created the instance of an object. 

Instance Methods:

 JavaScript Object Instance Methods

Description 

JavaScript Object.prototype.__defineGetter__() MethodThe __defineGetter__() method is used to bind an object’s property to a function which will be called when the specified property is looked up
JavaScript Object.prototype.hasOwnProperty() MethodThe hasOwnProperty() method in JavaScript is used to check whether the object has the specified property as its own property.
JavaScript Object.prototype.isPrototypeOf() MethodThe method isPrototypeOf() checks if an object exists in another object’s prototype chain.
JavaScript Object.prototype.propertyIsEnumerable() MethodThe method propertyIsEnumerable() returns a Boolean indicating whether the specified property is enumerable and is the object’s own property.

My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!