Skip to main content
Version: Next

objectIsEmpty

objectIsEmpty ( object : object ) : boolean

ParameterTypeDescription
objectobjectObject to check
Resultbooleantrue 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

See also

objectIsDefined