In GameMaker, the
is_array function is used to determine if a given variable is an array. It's a simple check that returns true if the variable is indeed an array, and false otherwise.
Here's how you can use the
Be aware that
is_array will only return true for variables that are explicitly arrays. GameMaker also supports other data structures like DS lists, maps, etc., and
is_array will return false for those even if they are collection types.
is_array can be very important when writing scripts that accept various types of arguments, or when you are unsure about the type of a certain dynamic variable at runtime. Proper type checking with functions like
is_array helps prevent errors and bugs related to incorrect type assumptions.