
如果其中一位为 1,则使用按位或 (|) 运算符时返回 1。
示例
您可以尝试运行以下代码来学习如何使用 JavaScript 按位或运算符。
<!DOCTYPE html>
<html>
<body>
<script>
document.write("Bitwise OR Operator<br>");
// 7 = 00000000000000000000000000000111
// 1 = 00000000000000000000000000000001
document.write(7 | 1);
</script>
</body>
</html>











