The "is_empty" Function
#
SyntaxArgument | Type | Description |
---|---|---|
val | any | A variable/value to check |
#
DescriptionChecks if a given value is "empty", which can be true
or false
depending on the type of data contained in the input value.
Some examples of "empty" data include:
undefined
NaN
false
- 0
- "0"
- ""
- []
- {}
- etc.
If the input value points to a data structure, buffer, etc., the structure will be considered empty if no values exist inside the structure itself. Transparent surfaces are also considered empty.
Some types of data cannot be evaluated and will return false
by default. Also note that different data types incur different performance costs to evaluate.
caution
Note that in some cases this function may not return the expected result due to the way GameMaker handles pointers. This means some types of data can share the same value, and whichever one happens to be first will take priority.