docs(10_Wiki): W3Schools 위키화 — HTML/CSS/JavaScript(core)

W3Schools 튜토리얼을 P-Reinforce v3.1 포맷으로 위키화(영어 본문, 한/영 섹션 헤더).
- Topic_HTML: 59문서 (튜토리얼+예제, 레퍼런스/메타 제외)
- Topic_CSS: 190문서 (메인 + Advanced/Flexbox/Grid/RWD 전체)
- Topic_JavaScript: 120문서 (코어 언어; Temporal/DOM상세/BOM/WebAPI/AJAX/jQuery/Graphics 등은 후속)
각 폴더 00_INDEX.md(MOC) 포함. 코드 verbatim, 미확인분은 "Not found in source" 표기.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-23 19:21:18 +09:00
parent 8957890d13
commit 9609c04755
379 changed files with 54618 additions and 6 deletions
@@ -0,0 +1,84 @@
---
id: javascript-conditional-operators
title: "JavaScript Conditional Operators"
category: "Frontend"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["JS conditional statements", "conditional statements", "ternary operator", "if else switch overview", "control flow", "decision statements"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.86
created_at: 2026-06-23
updated_at: 2026-06-23
review_reason: ""
merge_history: []
tags: ["javascript", "js", "web", "frontend", "w3schools", "conditionals", "control-flow"]
raw_sources: ["https://www.w3schools.com/js/js_conditionals.asp"]
applied_in: []
github_commit: ""
---
# [[JavaScript Conditional Operators]]
## 🎯 한 줄 통찰 (One-line insight)
Conditional statements run different code depending on `true`/`false` conditions — JavaScript provides `if`, `else`, `else if`, `switch`, and the ternary `(? :)` shorthand. [S1]
## 🧠 핵심 개념 (Core concepts)
- **Conditional statements branch on conditions** — they let you perform different actions for different conditions. [S1]
- **`if`** — use `if` to specify a code block to be executed if a specified condition is `true`. [S1]
- **`else`** — use `else` to specify a code block to be executed if the same condition is `false`. [S1]
- **`else if`** — use `else if` to specify a new condition to test if the first condition is `false`. [S1]
- **`switch`** — use `switch` to specify many alternative code blocks to be executed. [S1]
- **Ternary `(? :)`** — use `(? :)` (ternary) as a shorthand for `if...else`. [S1]
## 🧩 추출된 패턴 (Extracted patterns)
- **Pick the right branching construct** — single decision → `if`/`else`; chained conditions → `else if`; many discrete cases → `switch`; one-line value choice → ternary. [S1]
- **Ternary as expression** — the ternary form `condition ? expression1 : expression2` returns a value, unlike statement-only `if`. [S1]
## 📖 세부 내용 (Details)
**Conditional Statements** [S1]
Conditional statements allow you to perform different actions for different conditions — running different code depending on `true` or `false` conditions. Conditional statements include:
- **if** — Use `if` to specify a code block to be executed, if a specified condition is `true`.
- **else** — Use `else` to specify a code block to be executed, if the same condition is `false`.
- **else if** — Use `else if` to specify a new condition to test, if the first condition is `false`.
- **switch** — Use `switch` to specify many alternative code blocks to be executed.
- **ternary (? :)** — Use `(? :)` (ternary) as a shorthand for `if...else`.
**Ternary (? :) syntax** [S1]
The page shows the ternary as a syntax template rather than a runnable named example:
```javascript
condition ? expression1 : expression2
```
This page is an overview/index of the conditional constructs; the detailed runnable examples live on the dedicated pages it links to. A concrete named-variable ternary example was Not found in source on this page.
## 🛠️ 적용 사례 (Applied in summary)
This is an overview page; it points to the dedicated `if`, `else`, `switch`, and ternary pages where the working examples reside. No external project/commit applications found in the source.
## 💻 코드 패턴 (Code patterns)
Ternary shorthand for `if...else`:
```javascript
condition ? expression1 : expression2
```
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
No contradictions found in the source.
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual (실제 적용 사례 발견 시 applied/validated로 승격 가능)
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.86
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[JavaScript Tutorial]]
- **관련 개념:** [[JavaScript If]], [[JavaScript If Else]], [[JavaScript Comparisons]], [[JavaScript Operators]]
- **참조 맥락:** The entry point for control-flow branching, referenced before choosing `if`/`else`/`switch`/ternary.
## 📚 출처 (Sources)
- [S1] W3Schools — JavaScript Conditional Operators — https://www.w3schools.com/js/js_conditionals.asp
## 📝 변경 이력 (Change history)
- 2026-06-23: Initial draft synthesized from the W3Schools "JavaScript Conditional Operators" page (Astra wiki-curation, P-Reinforce v3.1 format).