Return Variables Types

Hey MacScripters,
I’m making a large script that will be dealing with a ton of variables. Some of the variables returned could be strings or arrays, or strings or numbers, or even aliases and strings. Is there a simple function to return the variable type of a given variable? I know I could messily find it using try blocks and other tests, but is there just a simple function for it out there? Thank you,

~Josh Fletcher

every variable contains a class name. I use it a lot for parameters

it’s simpler as you think but remember it returns always the class of the content

set x to "hello word"
set xRef to a reference to x
class of x -- result: text
class of xRef --result: text

Exactly what I was looking for! Thank you so much!