JavaScript is an object-based language based on prototypes, rather than being class-based. Because of this different basis, it can be less apparent how JavaScript allows you to create hierarchies of objects and to have inheritance of properties and their values. This chapter attempts to clarify the situation.
The Object constructor creates an object wrapper.
Returns a reference to the Object function that created the instance's prototype. Note that the value of this property is a reference to the function itself, not a string containing the function's name. The value is only read-only for primitive values such as 1true and "test".
The Object.defineProperties() method defines new or modifies existing properties directly on an object, returning the object.
The Object.eval() method used to evaluate a string of JavaScript code in the context of an object, however, this method has been removed.
The Object.freeze() method freezes an object: that is, prevents new properties from being added to it; prevents existing properties from being removed; and prevents existing properties, or their enumerability, configurability, or writability, from being changed. In essence the object is made effectively immutable. The method returns the object being frozen.
The Object.getNotifer() method was used to create an object that allows to synthetically trigger a change, but has been deprecated and removed in browsers.
The Object.getOwnPropertyDescriptor() method returns a property descriptor for an own property (that is, one directly present on an object and not in the object's prototype chain) of a given object.
The Object.getOwnPropertyDescriptors() method returns all own property descriptors of a given object.
The Object.getOwnPropertySymbols() method returns an array of all symbol properties found directly upon a given object.
The Object.getPrototypeOf() method returns the prototype (i.e. the value of the internal [[Prototype]] property) of the specified object.
The hasOwnProperty() method returns a boolean indicating whether the object has the specified property.
The isPrototypeOf() method tests for an object in another object's prototype chain.
The Object.observe() method was used for asynchronously observing the changes to an object. It provided a stream of changes in the order in which they occur. However, this API has been deprecated and removed from browsers. You can use the more general Proxy object instead.
The propertyIsEnumerable() method returns a Boolean indicating whether the specified property is enumerable.
The Object.prototype property represents the Object prototype object.
The toLocaleString() method returns a string representing the object. This method is meant to be overridden by derived objects for locale-specific purposes.
The toSource() method returns a string representing the source code of the object.
The toString() method returns a string representing the object.