-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjs_number.html
More file actions
62 lines (50 loc) · 1.6 KB
/
js_number.html
File metadata and controls
62 lines (50 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<!--
* @由于个人水平有限, 难免有些错误, 还请指点:
* @Author: cpu_code
* @Date: 2020-10-16 16:30:34
* @LastEditTime: 2020-10-16 16:41:33
* @FilePath: \web\javascript\js_number\js_number.html
* @Gitee: [https://gitee.com/cpu_code](https://gitee.com/cpu_code)
* @Github: [https://github.com/CPU-Code](https://github.com/CPU-Code)
* @CSDN: [https://blog.csdn.net/qq_44226094](https://blog.csdn.net/qq_44226094)
* @Gitbook: [https://923992029.gitbook.io/cpucode/](https://923992029.gitbook.io/cpucode/)
-->
<!DOCTYPE html>
<html>
<head>
<meta lang="UTF-8">
<title>变量</title>
<script>
//定义变量
/* var a = 3;
alert(a);
a = "abc";
alert(a);*/
//定义number类型
var num = 1;
var num2 = 1.2;
var num3 = NaN;
//输出到页面上
document.write(num + "<br>");
document.write(num2 + "<br>");
document.write(num3 + "<br>");
//定义string类型
var str = "abc";
var str2 = 'aaa';
document.write(str + "<br>");
document.write(str2 + "<br>");
//定义boolean
var flag = null;
document.write(flag + "<br>");
// 定义null,undefined
var obj = null;
var obj2 = undefined;
var obj3;
document.write(obj + "<br>");
document.write(obj2 + "<br>");
document.write(obj3 + "<br>");
</script>
</head>
<body>
</body>
</html>