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:
@@ -0,0 +1,152 @@
|
||||
---
|
||||
id: javascript-functions
|
||||
title: "JavaScript Functions"
|
||||
category: "Frontend"
|
||||
status: "draft"
|
||||
verification_status: "conceptual"
|
||||
canonical_id: ""
|
||||
aliases: ["functions", "function declaration", "reusable code blocks", "function syntax", "local variables", "functions as variables"]
|
||||
duplicate_of: ""
|
||||
source_trust_level: "B"
|
||||
confidence_score: 0.87
|
||||
created_at: 2026-06-23
|
||||
updated_at: 2026-06-23
|
||||
review_reason: ""
|
||||
merge_history: []
|
||||
tags: ["javascript", "js", "web", "frontend", "w3schools", "functions"]
|
||||
raw_sources: ["https://www.w3schools.com/js/js_functions.asp"]
|
||||
applied_in: []
|
||||
github_commit: ""
|
||||
---
|
||||
|
||||
# [[JavaScript Functions]]
|
||||
|
||||
## 🎯 한 줄 통찰 (One-line insight)
|
||||
A JavaScript function is a reusable block of code designed for a particular task that runs only when it is called — write it once, run it many times. [S1]
|
||||
|
||||
## 🧠 핵심 개념 (Core concepts)
|
||||
- **Functions are reusable code blocks** designed to perform a particular task; they execute when they are called or invoked. [S1]
|
||||
- **Why use functions** — to reuse code (write once, run many times) and to organize code into manageable sections. [S1]
|
||||
- **Declaration syntax** — the `function` keyword, a name, a parenthesized parameter list, and a body in curly braces. [S1]
|
||||
- **Functions run when called** — the code inside runs only when something invokes the function with `()`. [S1]
|
||||
- **Local variables** — variables declared inside a function can only be accessed from within it; they are created when the function starts and deleted when it completes. [S1]
|
||||
- **Functions used as variables** — a function call can be used anywhere a value is expected, including inside string concatenation. [S1]
|
||||
|
||||
## 🧩 추출된 패턴 (Extracted patterns)
|
||||
- **Define → call** — declare a named function, then invoke it by name with parentheses to run its body. [S1]
|
||||
- **Parameterize for reuse** — accept parameters so the same function works on different inputs (`add(5, 5)`, `add(50, 50)`). [S1]
|
||||
- **Call as a value** — substitute a function call directly into an expression instead of storing it first. [S1]
|
||||
|
||||
## 📖 세부 내용 (Details)
|
||||
**Functions are Code Blocks** — functions are reusable code blocks designed to perform a particular task; they execute when they are called or invoked. [S1]
|
||||
|
||||
**Why Use Functions?** — functions let you reuse code (write once, run many times) and organize code into manageable sections. [S1]
|
||||
|
||||
**JavaScript Function Syntax** — a function is defined with the `function` keyword, a name, parameters in parentheses, and a body in curly braces: [S1]
|
||||
```javascript
|
||||
function name( p1, p2, ... ) {
|
||||
// code to be executed
|
||||
}
|
||||
```
|
||||
|
||||
**What Does a Function Look Like?** — a basic function declaration: [S1]
|
||||
```javascript
|
||||
function sayHello() {
|
||||
return "Hello World";
|
||||
}
|
||||
```
|
||||
|
||||
**Functions Run When You Call Them** — the function body runs when it is invoked, and its returned value can be stored: [S1]
|
||||
```javascript
|
||||
function sayHello() {
|
||||
return "Hello World";
|
||||
}
|
||||
|
||||
let message = sayHello();
|
||||
```
|
||||
|
||||
A function with parameters: [S1]
|
||||
```javascript
|
||||
function multiply(a, b) {
|
||||
return a * b;
|
||||
}
|
||||
```
|
||||
|
||||
**A Function Can Be Used Many Times** — the same definition is reused with different arguments: [S1]
|
||||
```javascript
|
||||
function add(a, b) {
|
||||
return a + b;
|
||||
}
|
||||
|
||||
let sum1 = add(5, 5);
|
||||
let sum2 = add(50, 50);
|
||||
```
|
||||
|
||||
**Local Variables** — variables declared inside a function can only be accessed from within the function; they are created when the function starts and deleted when it completes: [S1]
|
||||
```javascript
|
||||
// code here can NOT use carName
|
||||
|
||||
function myFunction() {
|
||||
let carName = "Volvo";
|
||||
// code here CAN use carName
|
||||
}
|
||||
|
||||
// code here can NOT use carName
|
||||
```
|
||||
|
||||
**Functions Used as Variables** — a function call can be used directly inside an expression: [S1]
|
||||
```javascript
|
||||
let x = toCelsius(77);
|
||||
let text = "The temperature is " + x + " Celsius";
|
||||
```
|
||||
And the call can be inlined directly: [S1]
|
||||
```javascript
|
||||
let text = "The temperature is " + toCelsius(77) + " Celsius";
|
||||
```
|
||||
|
||||
## 🛠️ 적용 사례 (Applied in summary)
|
||||
The page's own snippets are the canonical applied examples — `sayHello()`, `multiply(a, b)`, the reusable `add(a, b)`, the local-variable `myFunction()`, and the `toCelsius(77)` usage inside a string. No external project/commit applications found in the source.
|
||||
|
||||
## 💻 코드 패턴 (Code patterns)
|
||||
Declare and call a function (language: JavaScript):
|
||||
```javascript
|
||||
function sayHello() {
|
||||
return "Hello World";
|
||||
}
|
||||
|
||||
let message = sayHello();
|
||||
```
|
||||
Reuse with parameters:
|
||||
```javascript
|
||||
function add(a, b) {
|
||||
return a + b;
|
||||
}
|
||||
|
||||
let sum1 = add(5, 5);
|
||||
let sum2 = add(50, 50);
|
||||
```
|
||||
Use a function call as a value:
|
||||
```javascript
|
||||
let text = "The temperature is " + toCelsius(77) + " Celsius";
|
||||
```
|
||||
|
||||
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
|
||||
No contradictions found in the source.
|
||||
|
||||
## ✅ 검증 상태 및 신뢰도
|
||||
- **상태:** draft
|
||||
- **검증 단계:** conceptual (실제 적용 사례 발견 시 applied/validated로 승격 가능)
|
||||
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
|
||||
- **신뢰 점수:** 0.87
|
||||
- **중복 검사 결과:** 신규 생성 (New discovery)
|
||||
|
||||
## 🔗 지식 그래프 (Knowledge Graph)
|
||||
- **상위/루트:** [[JavaScript Tutorial]]
|
||||
- **관련 개념:** [[JavaScript Function Definitions]], [[JavaScript Function Invocation]], [[JavaScript Function Parameters]], [[JavaScript Function Returns]]
|
||||
- **참조 맥락:** The entry point referenced whenever packaging reusable behavior into named, callable blocks.
|
||||
|
||||
## 📚 출처 (Sources)
|
||||
- [S1] W3Schools — JavaScript Functions — https://www.w3schools.com/js/js_functions.asp
|
||||
|
||||
## 📝 변경 이력 (Change history)
|
||||
- 2026-06-23: Initial draft synthesized from the W3Schools "JavaScript Functions" page (Astra wiki-curation, P-Reinforce v3.1 format).
|
||||
Reference in New Issue
Block a user