Results 1 - 20 of 57

Details of the object model

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.
Guide Intermediate JavaScript Object


The Object constructor creates an object wrapper.
Constructor JavaScript Object


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".
JavaScript Object Property Prototype


The Object.defineProperties() method defines new or modifies existing properties directly on an object, returning the object.
ECMAScript5 JavaScript Method 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.
JavaScript Method Object Obsolete


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.
ECMAScript5 JavaScript Method Object


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.
JavaScript Method Object Obsolete


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.
ECMAScript5 JavaScript Method Object


The Object.getOwnPropertyDescriptors() method returns all own property descriptors of a given object.
JavaScript Method Object


The Object.getOwnPropertySymbols() method returns an array of all symbol properties found directly upon a given object.
ECMAScript6 JavaScript Method Object


The Object.getPrototypeOf() method returns the prototype (i.e. the value of the internal [[Prototype]] property) of the specified object.
ECMAScript5 JavaScript Method Object


The hasOwnProperty() method returns a boolean indicating whether the object has the specified property.
JavaScript Method Object Prototype


The isPrototypeOf() method tests for an object in another object's prototype chain.
JavaScript Method Object Prototype


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.
JavaScript Method Object Obsolete


The propertyIsEnumerable() method returns a Boolean indicating whether the specified property is enumerable.
JavaScript Method Object Prototype


The Object.prototype property represents the Object prototype object.
JavaScript Object Property


The toLocaleString() method returns a string representing the object. This method is meant to be overridden by derived objects for locale-specific purposes.
JavaScript Method Object Prototype


The toSource() method returns a string representing the source code of the object.
JavaScript Method Object Prototype


The toString() method returns a string representing the object.
JavaScript Method Object Prototype