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 2015년 7월.
단항 더하기 연산자(+)는 피연산자 앞에 위치하며 피연산자를 평가하지만, 만약 피연산자가 숫자가 아니라면 숫자로 변환을 시도합니다.
단항 부정 (-)도 숫자가 아닌 값을 변환할 수 있지만, 단항 더하기는 어떤 것을 숫자로 변환하는 가장 빠르고 선호하는 방법입니다. 왜냐하면 숫자에 대해 다른 연산을 수행하지 않기 때문입니다. 정수와 실수의 문자열 표현뿐 아니라 문자열이 아닌 값인 true, false 및 null 또한 변환할 수 있습니다. 10진수 및 16진수(0x 접두사) 형식의 정수 모두 지원됩니다. 음수도 지원됩니다(16진수 제외). BigInt 값에 연산자를 사용하면 TypeError가 발생합니다. 특정 값을 구문 분석할 수 없으면 NaN으로 평가됩니다.
| ECMAScript® 2027 Language Specification # sec-unary-plus-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.