-
Notifications
You must be signed in to change notification settings - Fork 8.2k
[ko]: add translation for Logical OR assignment operator #27601
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[ko]: add translation for Logical OR assignment operator #27601
Conversation
|
||
## 설명 | ||
|
||
논리 OR 할당은 [_단축 평가_](/en-US/docs/Web/JavaScript/Reference/Operators/Operator_precedence#short-circuiting)를 수행합니다. 즉, `x ||= y`는 `x || (x = y)`와 동일하지만, 표현식 `x`는 한 번만 평가된다는 차이가 있습니다. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[mdn-linter] reported by reviewdog 🐶
논리 OR 할당은 [_단축 평가_](/en-US/docs/Web/JavaScript/Reference/Operators/Operator_precedence#short-circuiting)를 수행합니다. 즉, `x ||= y`는 `x || (x = y)`와 동일하지만, 표현식 `x`는 한 번만 평가된다는 차이가 있습니다. | |
논리 OR 할당은 [_단축 평가_](/ko/docs/Web/JavaScript/Reference/Operators/Operator_precedence#short-circuiting)를 수행합니다. 즉, `x ||= y`는 `x || (x = y)`와 동일하지만, 표현식 `x`는 한 번만 평가된다는 차이가 있습니다. |
|
||
논리 OR 할당은 [_단축 평가_](/en-US/docs/Web/JavaScript/Reference/Operators/Operator_precedence#short-circuiting)를 수행합니다. 즉, `x ||= y`는 `x || (x = y)`와 동일하지만, 표현식 `x`는 한 번만 평가된다는 차이가 있습니다. | ||
|
||
[논리 OR](/en-US/docs/Web/JavaScript/Reference/Operators/Logical_OR) 연산자의 단축 평가로 인해 왼쪽 피연산자가 falsy가 아닌 경우에는 할당이 수행되지 않습니다. 예를 들어, `x`가 `const`임에도 불구하고 다음 코드는 오류를 발생시키지 않습니다: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[mdn-linter] reported by reviewdog 🐶
[논리 OR](/en-US/docs/Web/JavaScript/Reference/Operators/Logical_OR) 연산자의 단축 평가로 인해 왼쪽 피연산자가 falsy가 아닌 경우에는 할당이 수행되지 않습니다. 예를 들어, `x`가 `const`임에도 불구하고 다음 코드는 오류를 발생시키지 않습니다: | |
[논리 OR](/ko/docs/Web/JavaScript/Reference/Operators/Logical_OR) 연산자의 단축 평가로 인해 왼쪽 피연산자가 falsy가 아닌 경우에는 할당이 수행되지 않습니다. 예를 들어, `x`가 `const`임에도 불구하고 다음 코드는 오류를 발생시키지 않습니다: |
|
||
여기서 단축 평가는 특히 유용한데, 요소가 불필요하게 업데이트되지 않아 추가적인 구문 분석이나 렌더링 작업, 포커스 손실 등의 원치 않는 부작용을 방지할 수 있기 때문입니다. | ||
|
||
참고: 확인하려는 API가 반환하는 값에 주의를 기울이세요. 빈 문자열({{Glossary("falsy")}} 값)이 반환되는 경우 `||=`를 사용해야 하며, 이 경우 빈 공간 대신 "가사가 없습니다."가 표시됩니다. 하지만 API가 빈 내용일 때 [`null`](/en-US/docs/Web/JavaScript/Reference/Operators/null) 또는 {{jsxref("undefined")}}를 반환하는 경우에는 [`??=`](/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing_assignment)를 대신 사용해야 합니다. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[mdn-linter] reported by reviewdog 🐶
참고: 확인하려는 API가 반환하는 값에 주의를 기울이세요. 빈 문자열({{Glossary("falsy")}} 값)이 반환되는 경우 `||=`를 사용해야 하며, 이 경우 빈 공간 대신 "가사가 없습니다."가 표시됩니다. 하지만 API가 빈 내용일 때 [`null`](/en-US/docs/Web/JavaScript/Reference/Operators/null) 또는 {{jsxref("undefined")}}를 반환하는 경우에는 [`??=`](/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing_assignment)를 대신 사용해야 합니다. | |
참고: 확인하려는 API가 반환하는 값에 주의를 기울이세요. 빈 문자열({{Glossary("falsy")}} 값)이 반환되는 경우 `||=`를 사용해야 하며, 이 경우 빈 공간 대신 "가사가 없습니다."가 표시됩니다. 하지만 API가 빈 내용일 때 [`null`](/ko/docs/Web/JavaScript/Reference/Operators/null) 또는 {{jsxref("undefined")}}를 반환하는 경우에는 [`??=`](/ko/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing_assignment)를 대신 사용해야 합니다. |
- [논리 OR (`||`)](/en-US/docs/Web/JavaScript/Reference/Operators/Logical_OR) | ||
- [널 병합 연산자 (`??`)](/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing) | ||
- [비트 OR 할당 (`|=`)](/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_OR_assignment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[mdn-linter] reported by reviewdog 🐶
- [논리 OR (`||`)](/en-US/docs/Web/JavaScript/Reference/Operators/Logical_OR) | |
- [널 병합 연산자 (`??`)](/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing) | |
- [비트 OR 할당 (`|=`)](/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_OR_assignment) | |
- [논리 OR (`||`)](/ko/docs/Web/JavaScript/Reference/Operators/Logical_OR) | |
- [널 병합 연산자 (`??`)](/ko/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing) | |
- [비트 OR 할당 (`|=`)](/ko/docs/Web/JavaScript/Reference/Operators/Bitwise_OR_assignment) |
Description
JavaScript의
논리 OR 할당 (||=) 연산자
문서를 한국어로 번역했습니다.MDN 한국어 번역 가이드라인을 준수하여 번역을 진행했으며, 기술 용어의 일관성과 가독성을 고려했습니다.
Motivation
한국어를 사용하는 개발자들이 JavaScript의 논리 OR 할당 연산자를 더 쉽게 이해하고 활용할 수 있도록 돕기 위해 번역을 진행했습니다.
이 문서는 JavaScript의 주요 연산자 중 하나를 다루고 있어, 한국어로 된 정확한 설명이 필요하다고 판단했습니다.
Additional details
Related issues and pull requests
(없음)