<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>变量定义及类型</title>
</head>
<body>
<script>
// 定义变量的关键字
//Javescript数据类型:undefined;number;string;boolean;object;null
var x;
alert(typeof(x));
x = 1;
x -= 8.3;
alert(typeof(x));
x = "hello";
alert(typeof(x));
x = true;
x = false;
alert(typeof(x));
x = {};
alert(typeof(x));
x = null;
alert(typeof(x));
</script>
</body>
</html>
Javescript变量定义及类型
最新推荐文章于 2022-04-14 22:02:08 发布