xxxxxxxxxx
<!DOCTYPE html>
<html>
<title>JavaScript typeof 示例 - 基础教程(div.cn)</title>
<body>
<p id="output"></p>
<script>
let x1 = {};
let x2 = "";
let x3 = 0;
let x4 = false;
let x5 = [];
let x6 = /()/;
let x7 = function(){};
document.getElementById("output").innerHTML =
"x1: " + typeof x1 + "<br>" +
"x2: " + typeof x2 + "<br>" +
"x3: " + typeof x3 + "<br>" +
"x4: " + typeof x4 + "<br>" +
"x5: " + typeof x5 + "<br>" +
"x6: " + typeof x6 + "<br>" +
"x7: " + typeof x7;
</script>
</body>
</html>