Jamie Balfour

Welcome to my personal website.

Find out more about me, my personal projects, reviews, courses and much more here.

Official ZPE/YASS documentationtype

Official ZPE/YASS documentationtype

type (mixed o) ⇒ string

Returns the type of a variable stored in the memory or the type of a value. It's important to note that comparing types of values should not be done by comparing the result of the type command against an integer value but it should be compared against another type function. E.g. the first example following is not recommended but the second example is:
type([32, 44]) == 6
type([32, 44]) == type([])

Alternative function names: get_type
First available: Version 1.3.3

Notes

Further to the above, this changed in version 1.7.x where the function would return LIST, INT, STRING, BOOLEAN etc as the return values rather than the word list, integer etc. Future versions may also change this or add types, thus, it is more effective to use the method described above.

Of course, this function is intended to be used with variables rather than comparing static values.

Comments
Feedback 👍
Comments are sent via email to me.