Object
Module | ejs |
Namespace | intrinsic |
Definition | dynamic class Object |
Inheritance | Object |
The Object Class is the root class from which all objects are based.
It provides a foundation set of functions and properties which are available to all objects. It provides for: copying objects, evaluating equality of objects, providing information about base classes, serialization and deserialization and iteration.
Properties
Qualifiers | Property | Type | Description |
---|---|---|---|
No properties defined |
Object Methods
Qualifiers | Method |
---|---|
public | clone(deep: Boolean): Array |
Clone the array and all its elements. | |
iterator | get(deep: Boolean, namespaces: Array): Iterator |
Get an iterator for this object to be used by "for (v in obj)". | |
iterator | getValues(deep: Boolean, namespaces: Array): Iterator |
Get an iterator for this object to be used by "for each (v in obj)". | |
public get | length(): Number |
The length of the object. | |
public | toJSON(): String |
Convert an object to an equivalent JSON encoding. | |
public | toString(locale: String): String |
This function converts an object to a string representation. |
Method Detail
Clone the array and all its elements.
- Parameters
deep: Boolean If true, do a deep copy where all object references are also copied, and so on, recursively. [default: true]
- Specified
- Ejs-11.
get public length(): Number
The length of the object.
- Returns
- Returns the most natural size or length for the object. For types based on Object, the number of properties will be returned. For Arrays, the number of elements will be returned. For some types, the size property may be writable. For null objects the length is 0; for undefined objects the length is -1. BUG: ECMA specifies to return 1 always.
public toJSON(): String
Convert an object to an equivalent JSON encoding.
- Returns
- This function returns an object literal string.
Throws
TypeError: If the object could not be converted to a string.
This function converts an object to a string representation.
- Description
- Types typically override this to provide the best string representation.
- Parameters
locale: String
- Returns
- A string representation of the object. For Objects "[object className]" will be returned, where className is set to the name of the class on which the object was based.