Get to know MDN better
This page was translated from English by the community. Learn more and join the MDN Web Docs community.
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2017년 3월.
거듭제곱 연산자(**)는 왼쪽 피연산자를 밑, 오른쪽 피연산자를 지수로 한 값을 구합니다. BigInt도 피연산자로 받을 수 있다는 점을 제외하면 Math.pow()와 같습니다.
거듭제곱 연산자는 우측 결합성을 가집니다. 따라서 a ** b ** c는 a ** (b ** c)와 같습니다.
PHP, Python 등 거듭제곱 연산자(**)를 포함하는 언어의 대부분은 거듭제곱 연산자가 단항 연산자(단항 +, - 등)보다 높은 우선순위를 가집니다. 그러나 Bash처럼 단항 연산자가 더 높은 우선순위를 가지는 예외의 언어도 있습니다.
반면 JavaScript에서는 모호한 거듭제곱 표현식을 작성하는 것이 불가능합니다. 단항 연산자(+/-/~/!/delete/void/typeof)를 밑 피연산자의 바로 앞에 사용할 수 없으며, 사용하려고 하면 SyntaxError가 발생합니다.
참고로 어떤 언어에선 캐럿 기호 ^를 거듭제곱에 사용하지만, JavaScript에서 캐럿은 비트 XOR 연산자에서 사용합니다.
거듭제곱 결과의 부호를 반전하려면,
거듭제곱 표현식의 밑에 음수를 제공하려면,
| ECMAScript® 2027 Language Specification # sec-exp-operator |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 2025년 2월 11일 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.