The Javascript typeof special operator is used to return the data type of an object. You can also access the constructor property of objects to see the constructor function they use.
Javascript CODE EXAMPLE
var v1 = "Welcome Partner";
var v2 = 50;
var v3 = new Object();
var v4 = Function();
var output = "<h3>Determine object types</h3>";
output += "v1 • "+typeof(v1)+" • "+v1.constructor+"<br />";
output += "v2 • "+typeof(v2)+" • "+v2.constructor+"<br />";
output += "v3 • "+typeof(v3)+" • "+v3.constructor+"<br />";
output += "v4 • "+typeof(v4)+" • "+v4.constructor+"<br />";
document.write(output);