Built-In Namespace Object
Method Attributes | Method Name and Description |
---|---|
extend()
Extend an object by merging in the members of the objects specified as parameters.
|
|
toJSON()
Return this object formatted as a JSON
String . |
Method Detail
extend()
Extend an object by merging in the members of the objects specified as parameters. Note: the merge is perfomed in-place, so the calling object can potentially be modified.
The parameters are merged such that the members of the right-most parameter overwrite those of the other parameters.
<? var a = { foo: "bar"; }; print( a.toJSON() ); // { "foo": "bar" } print("<br/>"); print( a.extend({ bar: "baz" }).toJSON() ); // {"foo":"bar","bar":"baz"} print("<br/>"); print( a.toJSON() ); // {"foo":"bar","bar":"baz"} <-- same as above! ?>
- Parameters:
- ]]
- Source objects to merge into target.
{...}
{String}
toJSON()
Return this object formatted as a JSON
String
.
- Returns:
- A
String
representing this object in JSON format.