Files
2nd/10_Wiki/Dev/Topic_JavaScript/JavaScript_Object_Methods.md
T
Antigravity Agent 1cfd3bbb56 docs(10_Wiki): 위키 구조 정리 — 언어 튜토리얼 카테고리 폴더 제거 + 신규 자산 동기화
Topic_CSS/Topic_HTML/Topic_JavaScript/Topic_Prompt/Topic_Comfyui 등 기존 카테고리 폴더를 정리하고,
Topic_Graphic/Dev 등 신규 산출물과 Topics 내부 세션/메모리 기록을 동기화.
2026-07-05 00:10:59 +09:00

5.9 KiB

id, title, category, status, verification_status, canonical_id, aliases, duplicate_of, source_trust_level, confidence_score, created_at, updated_at, review_reason, merge_history, tags, raw_sources, applied_in, github_commit
id title category status verification_status canonical_id aliases duplicate_of source_trust_level confidence_score created_at updated_at review_reason merge_history tags raw_sources applied_in github_commit
javascript-object-methods JavaScript Object Methods Frontend draft conceptual
JS object methods
object method
this keyword
method call parentheses
fullName
function as property
B 0.89 2026-06-23 2026-06-23
javascript
js
web
frontend
w3schools
objects
methods
this
https://www.w3schools.com/js/js_object_methods.asp

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 methodperson.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 methodfullName: function() { return this.firstName + " " + this.lastName; } combines own properties. [S1]
  • Late method attachmentperson.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]

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]

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]

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]

objectName.methodName()

If you call a method with parentheses, it executes as a function: [S1]

name = person.fullName();

If you call a method without parentheses, it returns the function definition: [S1]

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]

// 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]

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:

fullName: function() {
  return this.firstName + " " + this.lastName;
}

Add a method by assignment:

person.name = function () {
  return this.firstName + " " + this.lastName;
};

Compose with a built-in:

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)

📚 출처 (Sources)

📝 변경 이력 (Change history)

  • 2026-06-23: Initial draft synthesized from the W3Schools "JavaScript Object Methods" page (Astra wiki-curation, P-Reinforce v3.1 format).