code:
var myVariable;
if ( typeof myVariable === 'undefined' ) Debug.Trace ( 'Your variable is empty' );
else Debug.Trace( typeof myVariable );
Each variable has a "type" if the variable is empty it will be undefined.
This checks if the veriable has been initialized as a specific type. Mattike's post is more correct