TYPEOF
Last updated
Was this helpful?
Last updated
Was this helpful?
The TYPEOF function returns the data type of the input.
This function takes a single piece of input of any . It then outputs indicating the input's data type.
value (required, type: any) A value of any data type.
type (type: string) The determined of the given value, if found.
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:
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":
The examples given above are far from comprehensive. For more insight into what data types the TYPEOF function might recognize, check out the . There is, however, one data type recognized by TYPEOF that is not discussed in the Data Types Overview, and that's the , which TYPEOF calls an "appobject".