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.
This commit is contained in:
Antigravity Agent
2026-07-05 00:39:13 +09:00
parent 9148c358d0
commit e9cbf23ab5
1356 changed files with 0 additions and 12831 deletions
@@ -0,0 +1,136 @@
---
id: javascript-object-this
title: "JavaScript Object this"
category: "Frontend"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["JS this keyword", "this in objects", "this alone", "this in a function", "global object", "window object"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.88
created_at: 2026-06-23
updated_at: 2026-06-23
review_reason: ""
merge_history: []
tags: ["javascript", "js", "web", "frontend", "w3schools", "objects", "this", "context"]
raw_sources: ["https://www.w3schools.com/js/js_object_this.asp"]
applied_in: []
github_commit: ""
---
# [[JavaScript Object this]]
## 🎯 한 줄 통찰 (One-line insight)
`this` refers to the object calling a method — inside an object method it is that object, but used alone or in a regular function it refers to the global object. [S1]
## 🧠 핵심 개념 (Core concepts)
- **`this` refers to an object** — it is used to access the object that is calling a method. [S1]
- **In an object method, `this` is the object** — it lets the method access the object's properties. [S1]
- **Reusable methods** — `this` makes it possible to use the same method with different objects. [S1]
- **`this` alone is the global object** — in a browser that is the `window` object; in strict mode it is `undefined`. [S1]
- **In a regular function, `this` is the global object** too. [S1]
## 🧩 추출된 패턴 (Extracted patterns)
- **Shared-method pattern** — define the same `hello()` method on multiple objects so each resolves `this.name` to its own value. [S1]
- **Property access via `this`** — `this.firstName` / `this.lastName` reach own properties from within a method. [S1]
## 📖 세부 내용 (Details)
**this in Objects**
The `this` keyword refers to an object. In JavaScript, `this` is used to access the object that is calling a method. [S1]
**this in an Object Method**
When used inside an object method, `this` refers to the object. [S1]
```javascript
const person = {
firstName: "John",
lastName: "Doe",
age: 50,
fullName: function() {
return this.firstName + " " + this.lastName;
}
};
```
Here `this.firstName` refers to the `firstName` property of the person object, and `this.lastName` refers to the `lastName` property. [S1]
**Why Use this?**
The `this` keyword makes it possible to use the same method with different objects. [S1]
```javascript
const person1 = {
name: "John",
hello: function() {
return "Hello " + this.name;
}
};
const person2 = {
name: "Anna",
hello: function() {
return "Hello " + this.name;
}
};
document.getElementById("demo").innerHTML = person1.hello();
```
**this Alone**
When used alone, `this` refers to the global object. In a browser, the global object is the `window` object. In strict mode, `this` is `undefined` when used alone. [S1]
```javascript
let x = this;
document.getElementById("demo").innerHTML = x;
```
**this in a Function**
In a regular function, `this` also refers to the global object. [S1]
```javascript
function myFunction() {
return this;
}
document.getElementById("demo").innerHTML = myFunction();
```
**Summary**
In an object method, `this` refers to the object; `this` lets methods access object properties; used alone, `this` refers to the global object. [S1]
## ⚖️ 비교 및 선택 기준 (Comparison & decision criteria)
| Context | What `this` refers to |
| --- | --- |
| Inside an object method | The owning object [S1] |
| Used alone | The global object (`window` in a browser); `undefined` in strict mode [S1] |
| Inside a regular function | The global object [S1] |
## 🛠️ 적용 사례 (Applied in summary)
The page's own snippets are the canonical applied examples — `person.fullName` using `this`, the shared `hello()` method across `person1`/`person2`, and `this` returned alone and from a regular function. No external project/commit applications found in the source.
## 💻 코드 패턴 (Code patterns)
Same method, different objects:
```javascript
const person1 = { name: "John", hello: function() { return "Hello " + this.name; } };
const person2 = { name: "Anna", hello: function() { return "Hello " + this.name; } };
```
`this` alone resolves to the global object:
```javascript
let x = this;
```
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
No contradictions found in the source. The page notes a mode distinction: `this` used alone is the global object normally, but `undefined` in strict mode. [S1]
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual (실제 적용 사례 발견 시 applied/validated로 승격 가능)
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.88
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[JavaScript Tutorial]]
- **관련 개념:** [[JavaScript Object Methods]], [[JavaScript Objects]], [[JavaScript Arrow Functions]]
- **참조 맥락:** Referenced whenever reasoning about method context, and contrasted with arrow functions, which do not bind their own `this`.
## 📚 출처 (Sources)
- [S1] W3Schools — JavaScript Object this — https://www.w3schools.com/js/js_object_this.asp
## 📝 변경 이력 (Change history)
- 2026-06-23: Initial draft synthesized from the W3Schools "JavaScript Object this" page (Astra wiki-curation, P-Reinforce v3.1 format).