Get variable type : typeof « Operators « JavaScript Tutorial






<html>
<head>
<title>A Simple Page</title>
<script language="JavaScript">
<!--
var x = "Hello", y;
alert("Variable x value is " + typeof(x));
alert("Variable y value is " + typeof(y));
alert("Variable z value is " + typeof(z));
//  -->
</script>
</head>
<body>

</body>
</html>








2.13.typeof
2.13.1.The Typeof Operator
2.13.2.typeof
2.13.3.Get variable type
2.13.4.typeof a variable: number
2.13.5.typeof a variable: string