js返回数据类型
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script>
function test(){
//typeof 返回数据的类型
var a;
alert(typeof a); //undefined
alert(typeof null); //null ? object
alert(typeof true); //boolean
alert(typeof "abc");//string
alert(typeof NaN);//number
alert(typeof new Date());//object
}
test();
</script>
</head>
<body>
</body>
</html>