Files
cell/docs/dull/Object.md
2025-02-10 09:48:59 -06:00

88 lines
2.2 KiB
Markdown

# Object
### toString() <sub>function</sub>
Return a string representing this object. By default, it returns a string of the form '[object <className>]', where <className> is the object's class.
**Returns**: A string that describes the object.
### toLocaleString() <sub>function</sub>
Return a localized string representation of this object, calling toString() by default or a locale-specific override if defined.
**Returns**: A locale-sensitive string representation of the object.
### valueOf() <sub>function</sub>
Return the primitive value of this object if one exists. Typically, an object returns itself, while a wrapped type (e.g. Number, String) may return the underlying primitive value.
**Returns**: The primitive value of the object, or the object itself.
### hasOwnProperty(prop) <sub>function</sub>
Return a boolean indicating whether the object has a property with the specified name (key) as its own direct property, as opposed to inheriting it. It does not check the prototype chain.
**prop**: The name or Symbol of the property to test.
**Returns**: True if the property is found directly on the object, otherwise false.
### isPrototypeOf(obj) <sub>function</sub>
Return true if the object appears anywhere in the prototype chain of the specified object, otherwise false.
**obj**: The object whose prototype chain will be checked.
**Returns**: True if this object is in 'obj's prototype chain, otherwise false.
### propertyIsEnumerable(prop) <sub>function</sub>
Return a boolean indicating whether the specified property is enumerable, i.e., whether it shows up in a for...in loop or Object.keys() on the object.
**prop**: The name or Symbol of the property to test.
**Returns**: True if the property is found and enumerable, otherwise false.
### __proto__ <sub>accessor</sub>
### __defineGetter__() <sub>function</sub>
### __defineSetter__() <sub>function</sub>
### __lookupGetter__() <sub>function</sub>
### __lookupSetter__() <sub>function</sub>
### mixin(obj) <sub>function</sub>
Mix properties from 'obj' into the current object. If 'obj' is a string,
it first calls 'use(obj)' to retrieve the object.
**obj**: The object (or string reference to an object) to mix in.
**Returns**: None