Copy the code code as follows:
<html>
<head>
<title>The use of typeof in javascript</title>
<script>
//1.Basic type
var x = 123;
var y = "abc";
var z = true;
//alert(typeof x);//number
//alert(typeof y);//string
//alert(typeof z);//boolean
//2. Reference type, the type is object
var arr = new Array();
var date = new Date();
var str = new String("abc");
//alert(typeof arr);//object
//alert(typeof date);//object
//alert(typeof str);//object
//3. Object type can be understood as the simulation of classes in JavaScript is implemented through functions.
alert(typeof Array);//function
alert(typeof Date);//function
alert(typeof String);//function
</script>
</head>
<body>
</body>
</html>