To find the type of variable name use typeof().
JavaScript typeof operator tells you what type of data you're dealing with:
Example :
var str1 = "This is a string"
var arr1 = new Array("This", "is", "a", "string");
alert(typeof(str1)); // shows 'string' in the message box
alert(typeof(arr1)); // shows 'object' in the message box