0与1和true与false的关系
程序员文章站
2022-05-01 22:51:38
...
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<script>
console.log(true == 1) //true
console.log(false == 0) //false
console.log(true === 1) //false
console.log(false === 0) //false
</script>
</body>
</html>