Despite of its name Object is a class that contains methods of objects in script. For example here last line here will be evaluated to true:
var obj = { one:1, two:2 }; // creating object from literal if( obj instanceof Object ) stdout.printf( "I am an instance of Object" ); // will output this
class
.constructor, creates instance of Object class - object per se.
Returns string "[object Object]"
.
Returns object itself.
Makes copy of the object and returns it. If deep === true then it does recursive, deep cloning.
Extends the object by merging its properties from properties of object1, object2, etc.
Evaluates (interprets) what with context of this equal to the object. If namespace object is given then it is used as global namespace for evaluated code.
Returns list of property names defined on the object itself.
Creates a new object, using an existing object as the prototype of the newly created object.
If propertiesObject is provided then its properties are copied into newly created object.
Returns created object.
Copies the values of all own properties from one or more source objects to the target object.
Returns the target object.
Locks structure of the object - after the call any attempt to add or remove object's property will throw an error. Values of existing properties can be changed though. Returns the object itself. If strict parameter is provided and it is exactly true then any attempt to get unknown property will throw an error.
Returns true if the object is sealed. If strict parameter is provided and is exactly true then the method returns true only if seal(true) was called for it.
Locks the object - makes it immutable - any attempt to add, remove and modify value of any object's property will throw an error. Returns the object itself. If there is a strict parameter and it is exactly true then any attempt to get unknown property will throw an error.
Returns true if the object is frozen. If strict parameter is provided and is exactly true then the method returns true only if freeze(true) was called for it.
Attaches observer to the object - function that is called when the object changes. The observer here is a function that has following signature:
function observer(changeDefinition) {}
where changeDefinition is tuple having following fields:
[0]
- symbol, one of #add
- property added, #update
- property changed or #delete
- property deleted;[1]
- object, the object that property was changed;[2]
- symbol or string, property name;[3]
- any, new value;[4]
- any, old value.Detaches given observer function from the object by function reference or by its name.
When given dot separated path like "one.two.three" the function returns obj/key pair - object in which "three" key is defined and that key.