Files
2nd/10_Wiki/Topic_Programming/Topic_JavaScript/JavaScript_Assignment.md
T
Antigravity Agent e9cbf23ab5 docs(10_Wiki): Dev 폴더 누락분 반영 — Topic_Programming으로 통합
이전 재구성 작업에서 Dev/ 폴더가 누락되었던 것을 반영.

- Dev/Topic_Programming(중첩 폴더, 78개)은 Dev 자체 최상위 폴더들
  (Architecture/Conventions/Engineering_Intelligence 등)과 완전 중복이라 제거.
- Dev 최상위 엔지니어링 지식 폴더(Architecture/Conventions/Engineering_Intelligence/
  Failure_Library/Generalized_Principles/Language/Pattern_Catalog/Platform_Guides/
  Subsystems, 77개)는 이미 Topic_Programming/Topic_Programming에 더 최신 버전이
  존재해 중복 제거(고유 콘텐츠 1개는 예외 처리하여 이동 보존).
- Dev의 W3Schools 언어 튜토리얼 폴더(Topic_C/CPP/CSS/CSharp/HOWTO/HTML/Java/
  JavaScript/PHP/Python/SQL/W3CSS, 1201개)는 전부 Topic_Programming 하위로 이동.
- 에이전트 운영 상태(.astra/docs)는 그대로 유지, 콘텐츠 폴더만 정리.
- Topic_Programming 최종 문서 수: 2784 → 3985.
2026-07-05 00:39:13 +09:00

5.5 KiB

id, title, category, status, verification_status, canonical_id, aliases, duplicate_of, source_trust_level, confidence_score, created_at, updated_at, review_reason, merge_history, tags, raw_sources, applied_in, github_commit
id title category status verification_status canonical_id aliases duplicate_of source_trust_level confidence_score created_at updated_at review_reason merge_history tags raw_sources applied_in github_commit
javascript-assignment JavaScript Assignment Frontend draft conceptual
JS assignment operators
compound assignment
logical assignment
falsy values
truthy values
nullish coalescing assignment
spread operator
B 0.87 2026-06-23 2026-06-23
javascript
js
web
frontend
w3schools
assignment
operators
https://www.w3schools.com/js/js_assignment.asp

JavaScript Assignment

🎯 한 줄 통찰 (One-line insight)

Assignment operators assign values to variables — = for a plain assignment and compound forms (+=, -=, *=, **=, /=, %=) plus logical forms (&&=, ||=, ??=) for assign-and-operate in one step. [S1]

🧠 핵심 개념 (Core concepts)

  • Assignment operators assign values — they assign values to JavaScript variables. [S1]
  • Compound assignment — arithmetic compound operators combine an operation with assignment, e.g. x += y is the same as x = x + y. [S1]
  • Logical assignment&&=, ||=, and ??= assign conditionally based on truthiness/falsiness/nullishness. [S1]
  • 8 falsy valuesfalse, 0, -0, 0n, "" (empty strings), null, undefined, and NaN are falsy. [S1]
  • Truthy surprises"0", "false", [], and {} are truthy even though they look "empty". [S1]
  • Spread ... — the ... operator splits iterables into individual elements. [S1]

🧩 추출된 패턴 (Extracted patterns)

  • Mutate in place — apply an operation to a variable and store back with one compound operator (x += 5). [S1]
  • Conditional assignmentx ??= 10 assigns only when x is null/undefined; x ||= 10 when falsy; x &&= 10 when truthy. [S1]
  • Falsy check awareness — remember "0" and "false" strings (and []/{}) are truthy when writing conditions. [S1]

📖 세부 내용 (Details)

JavaScript Assignment Operators [S1] Assignment operators assign values to JavaScript variables. Using x = 10 and y = 5 for the examples below, the result column shows the value after applying the operator:

Operator Example Same As Result
= x = y x = y x = 5
+= x += y x = x + y x = 15
-= x -= y x = x - y x = 5
*= x *= y x = x * y x = 50
**= x **= y x = x ** y x = 100000
/= x /= y x = x / y x = 2
%= x %= y x = x % y x = 0

The = Operator [S1]

let x = 10;

The += Operator [S1]

let x = 10;
x += 5;

The -= Operator [S1]

let x = 10;
x -= 5;

*The = Operator [S1]

let x = 10;
x *= 5;

**The = Operator [S1]

let x = 10;
x **= 5;

The /= Operator [S1]

let x = 10;
x /= 5;

The %= Operator [S1]

let x = 10;
x %= 5;

Logical Assignment Operators [S1]

The &&= Operator (Logical AND assignment):

let x = true;
let y = x &&= 10;

The ||= Operator (Logical OR assignment):

let x = false;
let y = x ||= 10;

The ??= Operator (Nullish Coalescing assignment):

let x;
x ??= 10;

The 8 FALSY Values [S1] The following values are falsy: false, 0, -0, 0n, "" / '' / `` (empty strings), null, undefined, and NaN.

These are TRUTHY [S1] The following values are truthy: "0" (string), "false" (string), [] (empty array), and {} (empty object).

The Spread (...) Operator [S1] The ... operator splits iterables into individual elements.

🛠️ 적용 사례 (Applied in summary)

The page's own snippets are the canonical applied examples — each compound operator demonstrated against let x = 10, and the logical-assignment operators shown against boolean/undefined seeds. No external project/commit applications found in the source.

💻 코드 패턴 (Code patterns)

Compound arithmetic assignment:

let x = 10;
x += 5;

Nullish-coalescing assignment (only assigns when null/undefined):

let x;
x ??= 10;

Logical OR assignment (assigns when falsy):

let x = false;
let y = x ||= 10;

⚖️ 모순 및 업데이트 (Contradictions & updates)

No contradictions found in the source. Worth noting: "0", "false", [], and {} are truthy despite intuition, which the source explicitly flags.

검증 상태 및 신뢰도

  • 상태: draft
  • 검증 단계: conceptual (실제 적용 사례 발견 시 applied/validated로 승격 가능)
  • 출처 신뢰도: B (W3Schools — widely used educational reference, not a primary standards body)
  • 신뢰 점수: 0.87
  • 중복 검사 결과: 신규 생성 (New discovery)

🔗 지식 그래프 (Knowledge Graph)

📚 출처 (Sources)

📝 변경 이력 (Change history)

  • 2026-06-23: Initial draft synthesized from the W3Schools "JavaScript Assignment" page (Astra wiki-curation, P-Reinforce v3.1 format).