Global
js engine core methods
- clone
- clones a object with to with its own new memory space
- dump
- print object for debugging purposes
- getObjectKey
- Get the name of one of the values in the given object. Also see `getObjectSize` for the max index value.
- getObjectKeyIndex
- get the index of item with a specific key name in a object
- getObjectSize
- Get the number of key value pairs in the given object to be retrieved with `getObjectKey` and `getObjectValue`
- getObjectValue
- Get the value of one of the key value pairs in the given object. Also see `getObjectSize` for the max index value.
- mergeObject
- Combines 2 objects by coping all properties from object 2 to 1 if the property does not exist yet.
- parseFloat
- get a float numerical value from a string
- parseInt
- get a integer numerical value from a string
- removeProperty
- Properties can be set to null but this method removes the reference.
- setObjectKey
- change the key name of one of the items with a specific index in a source object
- setObjectValue
- change the value of a item with the given index in a object
- sleepMs
- Pause execution of the recipe
- stringify
- get a string JSON representation of a object. equal to objectToString(object)
examples
function testParseFloat()
{
var flt = parseFloat("1.123");
return flt + 1; // returns integer 2.123
}
function testParseInt()
{
var i = parseInt("1.123");
return i + 1; // returns integer 2
}
function printObject()
{
var object = { "key", 0 };
return echo(stringify(object)); // returns string "{ "key", 0 }"
}