如果两个位均为1,则在使用按位AND(&)运算符时将返回1。
您可以尝试运行以下代码以了解如何使用JavaScript Bitwise AND运算符-
<!DOCTYPE html> <html> <body> <script> document.write("Bitwise AND Operator<br>"); //7 = 00000000000000000000000000000111- //1 = 000000000000000000000000000000000000 document.write(7 & 1); </script> </body> </html>