/* ******************************************************************************************* * GLOBAL OBJECTS > OBJECT * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object * ******************************************************************************************* */ // Global object: properties Object.length // length is a property of a function object, and indicates how many arguments the function expects, i.e. the number of formal parameters. This number does not include the rest parameter. Has a value of 1. Object.prototype // Represents the Object prototype object and allows to add new properties and methods to all objects of type Object. // Methods of the Object constructor Object.assign(target, ...sources) // Copies the values of all enumerable own properties from one or more source objects to a target object. method is used to copy the values of all enumerable own properties from one or more source objects to a target object. It will return the target object Object.create(MyObject) // Creates a new object with the specified prototype object and properties. The object which should be the prototype of the newly-created object. Object.defineProperty(obj, prop, descriptor) // Adds the named property described by a given descriptor to an object. Object.defineProperties(obj, props) // Adds the named properties described by the given descriptors to an object. Object.entries(obj) // Returns an array containing all of the [key, value] pairs of a given object's own enumerable string properties. Object.freeze(obj) // Freezes an object: other code can't delete or change any properties. Object.getOwnPropertyDescriptor(obj, prop) // Returns a property descriptor for a named property on an object. Object.getOwnPropertyDescriptors(obj) // Returns an object containing all own property descriptors for an object. Object.getOwnPropertyNames(obj) // Returns an array containing the names of all of the given object's own enumerable and non-enumerable properties. Object.getOwnPropertySymbols(obj) // Returns an array of all symbol properties found directly upon a given object. Object.getPrototypeOf(obj) // Returns the prototype of the specified object. Object.is(value1, value2); // Compares if two values are the same value. Equates all NaN values (which differs from both Abstract Equality Comparison and Strict Equality Comparison). Object.isExtensible(obj) // Determines if extending of an object is allowed. Object.isFrozen(obj) // Determines if an object was frozen. Object.isSealed(obj) // Determines if an object is sealed. Object.keys(obj) // Returns an array containing the names of all of the given object's own enumerable string properties. Object.preventExtensions(obj) // Prevents any extensions of an object. Object.seal(obj) // Prevents other code from deleting properties of an object. Object.setPrototypeOf(obj, prototype) // Sets the prototype (i.e., the internal [[Prototype]] property). Object.values(obj) // Returns an array containing the values that correspond to all of a given object's own enumerable string properties. // Object instances and Object prototype object (Object.prototype.property or Object.prototype.method()) // Properties obj.constructor // Specifies the function that creates an object's prototype. obj.__proto__ // Points to the object which was used as prototype when the object was instantiated. // Methods obj.hasOwnProperty(prop) // Returns a boolean indicating whether an object contains the specified property as a direct property of that object and not inherited through the prototype chain. prototypeObj.isPrototypeOf(object) // Returns a boolean indicating whether the object this method is called upon is in the prototype chain of the specified object. obj.propertyIsEnumerable(prop) // Returns a boolean indicating if the internal ECMAScript [[Enumerable]] attribute is set. obj.toLocaleString() // Calls toString(). obj.toString() // Returns a string representation of the object. object.valueOf() // Returns the primitive value of the specified object.