self_example/java_web/JavaScript/html/05-数据类型.html

48 lines
686 B
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>04-变量</title>
</head>
<body>
<script>
//number
// var age=20;
// var price=99.8;
// alert(typeof age);
// alert(typeof price);
//string
// var ch='a';
// var name ='张三';
// var addr = "北京";
// alert(typeof ch);
// alert(typeof name);
// alert(typeof addr);
//boolean
// var flag1=true;
// var flag2=false;
//
// alert(typeof flag1);
// alert(typeof flag2);
//null
// var obj=null;
// alert(typeof obj); //object
//undefined
var a;
alert(typeof a); //undefined
</script>
</body>
</html>