Files
2nd/10_Wiki/Topic_Programming/Topic_JavaScript/JavaScript_Object_Methods.md
T
Antigravity Agent e9cbf23ab5 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.
2026-07-05 00:39:13 +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).