什么是 JavaScript 按位左移 (<<) 运算符?
htmljavascriptprogramming scripts
使用按位左移运算符,从右侧移位一个或多个零位。不考虑最左边的位。
示例
您可以尝试运行以下代码来了解如何使用 JavaScript 按位左移运算符。
<!DOCTYPE html> <html> <body> <script> document.write("Bitwise Left Shift Operator<br>"); // 7 = 00000000000000000000000000000111 document.write(7<<1); </script> </body> </html>