当jq1=numa>numb||numa;时,输出的结果是50,不是布尔值
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>逻辑或</title>
<script type="text/javascript">
var numa,numb,jq1;
numa=50;
numb=55;
jq1=numa>numb||numa;
document.write("jq1的值是:"+jq1+"<br>")
</script>
</head>
<body>
</body>
</html>jq1=numa>numb||numa;时,为什么输出的结果是50,而不是布尔值,如果连判断都不加的话:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>逻辑或</title>
<script type="text/javascript">
var numa,numb,jq1;
numa=50;
numb=55;
jq1=numb||numa;
document.write("jq1的值是:"+jq1+"<br>")
</script>
</head>
<body>
</body>
</html>输出的是55
这是因为没有给||加上条件,机器直接忽略了吗?