TYPEOF
The TYPEOF function returns the data type of the input.
This function takes a single piece of input of any data type. It then outputs Text indicating the input's data type.
Declaration
Parameters
value (required, type: any)
A value of any data type.
Return Values
type (type: string)
The determined data type of the given value, if found.
Examples
The following example takes the number 42 and determines that it is, in fact, a number:
The following example takes the list [1, 2, 3] and determines that it is, in fact, a list:
Regardless of the type of input TYPEOF is given, it will always return a string. This is demonstrated in the following example, where the output of one instance of the TYPEOF function is used as input in another TYPEOF function:
Discussion
The examples given above are far from comprehensive. For more insight into what data types the TYPEOF function might recognize, check out the Data Types Overview. There is, however, one data type recognized by TYPEOF that is not discussed in the Data Types Overview, and that's the AirData app object, which TYPEOF calls an "appobject".
Say the last example has access to the following app object:
The following example gives the app object identity as input for TYPEOF, which returns "appobject":
Last updated