refactor(topics): 멀티 에이전트용 지식 재편 — _Common(공통 기본기) + Domain_* 구조

에이전트 8종(대화형/프로그래머 C·S/디자이너/설계자/기획자/QA/PD/PM)에게
[공통 기본 능력 + 롤별 Specialty] 2층으로 지식을 주입하기 위한 재분류.
문서 내용·포맷은 무수정, 폴더 이동만 (6,372개 문서 수 보존 확인).

- Topic_Programming → Domain_Programming (내부 구조 보존)
- Topic_Graphic → Domain_Design
- Topic_Business → Domain_Product
- Topic_General → Domain_General
- _Common 신설: Math(구 Topic_Math_Specialty), Reasoning(구 General/From_Thinking & Reasoning),
  Reasoning_Creativity(구 General/From_창의성), Communication(Poetic_Blog_Writing + From_writing)
- 타 도메인의 From_* 폴더는 유지 (출처 표기일 뿐, 이미 도메인에 맞게 분류된 문서)
- 빈 폴더 정리 (memory/procedures)
- 에이전트→폴더 매핑은 workspace의 .astra/agent-knowledge-map.json (9개 에이전트)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Antigravity Agent
2026-07-11 11:05:56 +09:00
parent 6549ead309
commit c24165b8bc
6193 changed files with 1717 additions and 31 deletions
@@ -0,0 +1,217 @@
---
id: javascript-booleans
title: "JavaScript Booleans"
category: "Frontend"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["boolean", "true false", "JS booleans", "Boolean function", "truthy falsy"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.89
created_at: 2026-06-23
updated_at: 2026-06-23
review_reason: ""
merge_history: []
tags: ["javascript", "js", "web", "frontend", "w3schools", "boolean", "truthy", "data-types"]
raw_sources: ["https://www.w3schools.com/js/js_booleans.asp"]
applied_in: []
github_commit: ""
---
# [[JavaScript Booleans]]
## 🎯 한 줄 통찰 (One-line insight)
A Boolean is a primitive type with only two values — `true` or `false` — and the boolean value of an expression is the basis for all JavaScript comparisons and conditions. [S1]
## 🧠 핵심 개념 (Core concepts)
- **Two values only** — a Boolean can only have one of two values: `true` or `false`, written in lowercase and without quotes. [S1]
- **Comparisons return booleans** — all JavaScript comparison operators (`==`, `!=`, `<`, `>`) return `true` or `false`. [S1]
- **Drives control flow** — booleans are used in `if` statements and loops to decide which code blocks run. [S1]
- **`Boolean()` evaluates truthiness** — the `Boolean()` function reports whether an expression or variable is true. [S1]
- **Truthy vs falsy** — everything with a "value" is true; everything without a "value" is false. [S1]
- **Avoid Boolean objects** — booleans can be created as objects with `new Boolean()`, but this should not be done. [S1]
## 🧩 추출된 패턴 (Extracted patterns)
- **Coerce-to-boolean check** — wrap an expression in `Boolean(...)` (or rely on an expression like `(10 > 9)`) to obtain its truth value. [S1]
- **Truthiness rule** — empty arrays `[]` and empty objects `{}` are truthy because all objects evaluate to true; `0`, `""`, `undefined`, `null`, `NaN`, and `false` are falsy. [S1]
- **Never compare a primitive boolean to a Boolean object** — `(x == y)` may be true while `(x === y)` is false, and two objects always compare as not equal. [S1]
## 📖 세부 내용 (Details)
**The Boolean data type** [S1]
In JavaScript, a Boolean is a primitive data type that can only have one of two values: `true` or `false`. The boolean value of an expression is the basis for all JavaScript comparisons and conditions. `true` and `false` are boolean data types, are the only possible boolean values, and must be written in lowercase and without quotes.
**Boolean use cases** [S1]
Very often, in programming, you will need a data type that can represent one of two values, like: yes or no; on or off; true or false. Boolean values are fundamental for logical operations and control flow.
**Comparisons** [S1]
All JavaScript comparison operators (like `==`, `!=`, `<`, `>`) return `true` or `false`. Given that `x = 5`:
| Description | Example | Returns |
|---|---|---|
| Equal to | (x == 8) | false |
| Not equal to | (x != 8) | true |
| Greater than | (x > 8) | false |
| Less than | (x < 8) | true |
```javascript
let x = 5;
(x == 8); // equals false
(x != 8); // equals true
```
**Conditions** [S1]
Booleans are extensively used in `if` statements to determine which code blocks to execute.
| Example | Result |
|---|---|
| if (day == "Monday") | true or false |
| if (salary > 9000) | true or false |
| if (age < 18) | true or false |
```javascript
if (hour < 18) {
greeting = "Good day";
} else {
greeting = "Good evening";
}
```
**Loops** [S1]
Booleans are extensively used in loops to determine the looping condition.
| Description | Example |
|---|---|
| For loop | for (i = 0; i < 5; i++) |
| While loop | while (i < 10) |
| For in loop | for (x in person) |
| For of loop | for (x of cars) |
```javascript
while (i < 10) {
text += i;
i++;
}
```
**The `Boolean()` function** [S1]
You can use the `Boolean()` function to find out if an expression (or a variable) is true:
```javascript
Boolean(10 > 9)
```
Or even easier:
```javascript
(10 > 9)
```
**Everything with a "value" is true** [S1]
The following all evaluate to true: `100`, `3.14`, `-15`, `true`, `"Hello"`, `"false"`, `(7 + 1 + 3.14)`, `[ ]`, `{ }`.
Note: In JavaScript, both an empty array `[ ]` and an empty object `{ }` are truthy because they are objects. All objects in JavaScript evaluate to true in a boolean context, regardless of their content.
**Everything without a "value" is false** [S1]
The following all evaluate to false: `0`, `""`, `undefined`, `null`, `NaN`, `false`.
The boolean value of `0` (zero) is false:
```javascript
let x = 0;
Boolean(x);
```
The boolean value of `-0` (minus zero) is false:
```javascript
let x = -0;
Boolean(x);
```
The boolean value of `""` (empty string) is false:
```javascript
let x = "";
Boolean(x);
```
The boolean value of `undefined` is false:
```javascript
let x;
Boolean(x);
```
The boolean value of `null` is false:
```javascript
let x = null;
Boolean(x);
```
The boolean value of `false` is false:
```javascript
let x = false;
Boolean(x);
```
The boolean value of `NaN` is false:
```javascript
let x = 10 / "Hallo";
Boolean(x);
```
**JavaScript booleans as objects** [S1]
Normally JavaScript booleans are primitive values created from literals:
```javascript
let x = false;
```
But booleans can also be defined as objects with the keyword `new`:
```javascript
let y = new Boolean(false);
```
```javascript
let x = false;
let y = new Boolean(false);
// typeof x returns boolean
// typeof y returns object
```
Warning: Do not create Boolean objects. The `new` keyword complicates the code and slows down execution speed. Boolean objects can produce unexpected results.
Booleans and boolean objects cannot be safely compared:
```javascript
let x = Boolean(false);
let y = new Boolean(false);
// (x == y) returns true
// (x === y) returns false
```
Comparing two JavaScript objects always returns false.
## 🛠️ 적용 사례 (Applied in summary)
The page's own snippets are the canonical applied examples — comparison results, an `if/else` greeting, a `while` accumulation loop, and `Boolean()` truthiness checks across falsy values. No external project/commit applications found in the source.
## 💻 코드 패턴 (Code patterns)
Check truthiness of an expression:
```javascript
Boolean(10 > 9)
```
Detect a falsy value:
```javascript
let x = "";
Boolean(x); // false
```
Avoid Boolean objects (anti-pattern noted by source):
```javascript
let y = new Boolean(false); // typeof y returns object
```
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
No contradictions found in the source. The source explicitly warns against the `new Boolean()` object form as an anti-pattern.
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual (실제 적용 사례 발견 시 applied/validated로 승격 가능)
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.89
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[JavaScript Tutorial]]
- **관련 개념:** [[JavaScript Comparisons]], [[JavaScript If Else]], [[JavaScript Logical]], [[JavaScript Data Types]]
- **참조 맥락:** Underlies every condition and comparison; central to truthy/falsy reasoning in conditionals and loops.
## 📚 출처 (Sources)
- [S1] W3Schools — JavaScript Booleans — https://www.w3schools.com/js/js_booleans.asp
## 📝 변경 이력 (Change history)
- 2026-06-23: Initial draft synthesized from the W3Schools "JavaScript Booleans" page (Astra wiki-curation, P-Reinforce v3.1 format).