运算符|| 是逻辑OR运算符。如果两个操作数中的任何一个都不为零,则条件变为true。
这是使用操作符的方式|| 在JavaScript中使用var-
<html>
<body>
<script>
var a = true;
var b = false;
document.write("(a || b) => ");
result = (a || b);
document.write(result);
</script>
</body>
</html>