objectIsEmpty
objectIsEmpty ( object : object ) : boolean
Parameter | Type | Description | |
---|---|---|---|
object | object | -> | Object to check |
Result | boolean | <- | true if object is empty or undefined, otherwise false |
Description
The objectIsEmpty
command returns true
if object is undefined or empty, and false
if object is defined (initialized) and contains at least one property.
Example
var ref : object
var empty, def : boolean
empty = objectIsEmpty(ref) // true
def = objectIsDefined(ref) // false
ref = {name : "Susie", age : 4}
empty = objectIsEmpty(ref) // false
def = objectIsDefined(ref) // true
objectRemove(ref,"name")
objectRemove(ref,"age")
empty = objectIsEmpty(ref) // true
def = objectIsDefined(ref) // true