JS_Boolean类型

JS_Boolean类型

Boolean布尔值

布尔值有两个,主要用来做逻辑判断

true

  表示真

false

  表示假

使用typeof检查一个布尔值时,会返回一个boolean
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script>
var isBingo = false;

console.log(typeof false);
console.log(typeof true);
console.log(isBingo);
</script>
</head>
<body>
</body>
</html>