|
|
How to find type of variable name? - Javascript
|
Views : 654
|
|
Tagged in : Javascript
|
|
|
Report This Scrap as Inappropriate We request you to choose the appropriate categroy and subcategory that suits your
objectionable concern about the scrap, So that our team can review and find out whether it violates our Guidelines or the
scrap is not suitable for all viewers.
|
Find type of variable name
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
|
|
By Sanju, On - 2009-10-01 |
|
|
|