docs(10_Wiki): 위키 구조 정리 — 언어 튜토리얼 카테고리 폴더 제거 + 신규 자산 동기화

Topic_CSS/Topic_HTML/Topic_JavaScript/Topic_Prompt/Topic_Comfyui 등 기존 카테고리 폴더를 정리하고,
Topic_Graphic/Dev 등 신규 산출물과 Topics 내부 세션/메모리 기록을 동기화.
This commit is contained in:
Antigravity Agent
2026-07-05 00:10:59 +09:00
parent a397bc4720
commit 1cfd3bbb56
1495 changed files with 68534 additions and 27 deletions
@@ -0,0 +1,164 @@
---
id: javascript-object-methods
title: "JavaScript Object Methods"
category: "Frontend"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["JS object methods", "object method", "this keyword", "method call parentheses", "fullName", "function as property"]
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", "objects", "methods", "this"]
raw_sources: ["https://www.w3schools.com/js/js_object_methods.asp"]
applied_in: []
github_commit: ""
---
# [[JavaScript Object Methods]]
## 🎯 한 줄 통찰 (One-line insight)
Methods are functions stored as object property values; call them with parentheses, and inside them `this` refers to the owning object. [S1]
## 🧠 핵심 개념 (Core concepts)
- **Methods are actions on objects** — they are functions stored as property values. [S1]
- **`this` is the object** — in an object method, `this` refers to the object that owns the method. [S1]
- **Parentheses execute the method** — `person.fullName()` runs the function; `person.fullName` returns the function definition. [S1]
- **Add methods by assignment** — assign a function to a property to add a method. [S1]
- **Built-in methods compose** — a method can call JavaScript built-ins such as `toUpperCase()`. [S1]
## 🧩 추출된 패턴 (Extracted patterns)
- **`this`-based accessor method** — `fullName: function() { return this.firstName + " " + this.lastName; }` combines own properties. [S1]
- **Late method attachment** — `person.name = function () { ... }` adds behavior to an existing object. [S1]
- **Method + built-in chaining** — wrap the result and call a built-in: `(this.firstName + " " + this.lastName).toUpperCase()`. [S1]
## 📖 세부 내용 (Details)
**What are Object Methods?**
Methods are actions that can be performed on objects. Methods are functions stored as property values. [S1]
```javascript
const person = {
firstName: "John",
lastName: "Doe",
age: 50,
fullName: function() {
return this.firstName + " " + this.lastName;
}
};
```
| Property | Value |
| --- | --- |
| firstName | John |
| lastName | Doe |
| age | 50 |
| **fullName** | **function() { return this.firstName + " " + this.lastName; }** |
**The this Keyword**
In an object method, `this` refers to the object. [S1]
```javascript
const person = {
firstName: "John",
lastName: "Doe",
id: 5566,
getId: function() {
return this.id;
}
};
let number = person.getId();
```
Here `this` refers to the person object; `this.id` means the `id` property of the person object. [S1]
```javascript
const person = {
firstName: "John",
lastName: "Doe",
age: 50,
fullName: function() {
return this.firstName + " " + this.lastName;
}
};
```
Here `this` refers to the person object; `this.firstName` means the `firstName` property and `this.lastName` the `lastName` property. [S1]
**Accessing Object Methods**
To call an object method, add parentheses `()`. Without parentheses you get the function itself. Syntax: [S1]
```javascript
objectName.methodName()
```
If you call a method with parentheses, it executes as a function: [S1]
```javascript
name = person.fullName();
```
If you call a method without parentheses, it returns the function definition: [S1]
```javascript
name = person.fullName;
```
**Adding a Method to an Object**
You can add a method to an object by assigning a function to a property: [S1]
```javascript
// Assign person.name to a function
person.name = function () {
return this.firstName + " " + this.lastName;
};
```
Here `person.name` is a property with a function assigned to it. [S1]
**Adding a JavaScript Method**
This example uses the JavaScript `toUpperCase()` method to convert a text to uppercase: [S1]
```javascript
person.name = function () {
return (this.firstName + " " + this.lastName).toUpperCase();
};
```
**Summary**
Methods are functions stored as object properties; call a method with parentheses (`person.fullName()`); in methods, `this` refers to the object; you can add methods to objects by assigning a function to a property. [S1]
## 🛠️ 적용 사례 (Applied in summary)
The page's own snippets are the canonical applied examples — the `fullName`/`getId` methods using `this`, the parentheses-vs-no-parentheses call comparison, and late attachment of `person.name`. No external project/commit applications found in the source.
## 💻 코드 패턴 (Code patterns)
Method using `this`:
```javascript
fullName: function() {
return this.firstName + " " + this.lastName;
}
```
Add a method by assignment:
```javascript
person.name = function () {
return this.firstName + " " + this.lastName;
};
```
Compose with a built-in:
```javascript
person.name = function () {
return (this.firstName + " " + this.lastName).toUpperCase();
};
```
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
No contradictions found in the source.
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual (실제 적용 사례 발견 시 applied/validated로 승격 가능)
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.89
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[JavaScript Tutorial]]
- **관련 개념:** [[JavaScript Objects]], [[JavaScript Object Properties]], [[JavaScript Object this]]
- **참조 맥락:** Referenced whenever attaching behavior to objects and reasoning about `this` inside methods.
## 📚 출처 (Sources)
- [S1] W3Schools — JavaScript Object Methods — https://www.w3schools.com/js/js_object_methods.asp
## 📝 변경 이력 (Change history)
- 2026-06-23: Initial draft synthesized from the W3Schools "JavaScript Object Methods" page (Astra wiki-curation, P-Reinforce v3.1 format).