什么是 JavaScript 按位与 (&) 运算符?
htmljavascriptprogramming scripts更新于 2024/6/6 2:20:17
如果两位都是 1,则使用按位与 (&) 运算符时返回 1。
示例
您可以尝试运行以下代码来了解如何使用 JavaScript 按位与运算符 −
<!DOCTYPE html>
<html>
<body>
<script>
document.write("Bitwise AND Operator<br>");
// 7 = 00000000000000000000000000000111
// 1 = 00000000000000000000000000000001
document.write(7 & 1);
</script>
</body>
</html>
相关文章
有用资源
html 参考教程 - 该教程包含有关 html 的更多信息:https://www.cainiaomax.com/html/

