objectRemove
objectRemove ( object : object , property : string )
Parameter | Type | Description | |
---|---|---|---|
object | object | → | Object to edit |
property | string | → | Name of property to remove |
Description
The objectRemove
command removes property from the object.
The command removes the property as well as its current value.
In the property parameter, pass the label of the property to be removed. Note that the property parameter is case sensitive.
If the property is not found at the first level of object, the command does nothing.
Example
var obj : object
obj = {name : "Smith", info: {a: 20, b: 30}}
objectRemove(obj, "name")
//obj: {"info": {"a": 20, "b": 30}}
objectRemove(obj.info, "b")
//obj: {"info": {"a": 20}}