35 lines
828 B
HTML
35 lines
828 B
HTML
<!DOCTYPE html>
|
||
<html lang="en">
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
<title>Document</title>
|
||
<script>
|
||
// var a=1
|
||
// function test(){
|
||
// alert(a) //undefined
|
||
// var a=2
|
||
// alert(a) //2
|
||
// }
|
||
// test()
|
||
// alert(a) // 1
|
||
// undefined 2 1
|
||
|
||
// alert(Boolean("non-empty string")) //true
|
||
// alert(Boolean(null)) //false
|
||
alert(alert(1)||2||alert(3)) //1
|
||
// alert(alert(1)&& alert(0)) //1
|
||
|
||
// &&如果第一个是false就不走第二个。
|
||
// alert没有返回值,所以布尔值是false
|
||
// ||是第一个true不走第二个
|
||
|
||
|
||
|
||
</script>
|
||
</head>
|
||
<body>
|
||
|
||
</body>
|
||
</html> |