is_enum

This function determines whether the provided value is an enumeration type member or not.

This function does not generate a change.

Function

is_enum(value)

Arguments

Argument Type Description
value any (required) The value to be tested.

Return value

Returns true if the given value is of type enum, else it returns false.

Example

This code shows some return values for is_enum():

set_enum('Status', {
    OK: 0,
    NOK: -1,
});

[
    is_enum( Status{OK} ),
    is_enum( 0 ),
];

Return value in JSON format

[
    true,
    false
]