[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Operators/Left_shift [Back]  [Original]

(<<) - JavaScript | MDN

This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

(<<)

Baseline
Widely available

This feature is well established and works across many devices and browser versions. Its been available across browsers since 2015 7.

(<<) (32 ) . . 0 .

In this article

const a = 5; // 00000000000000000000000000000101
const b = 2; // 00000000000000000000000000000010

console.log(a << b); // 00000000000000000000000000010100
// Expected output: 20

js
a << b

. . 0 .

, 9 << 2 36 .

     9 (10): 00000000000000000000000000001001 (2)
                  --------------------------------
9 << 2 (10): 00000000000000000000000000100100 (2) = 36 (10)

x y x * 2 ** y. 9 << 3 9 * (2 ** 3) = 9 * (8) = 72 .

32 . , 32 /.

32 32 0 31 . , 100 << 32 100 << 0 ( 100). 32 0 .

js
9 << 3; // 72
// 9 * (2 ** 3) = 9 * (8) = 72

Specification
ECMAScript 2027 LanguageSpecification
# sec-left-shift-operator


Web Proxy Viewer  |  New URL  |  Original Page