> For the complete documentation index, see [llms.txt](https://lifeoverflow.gitbook.io/learning-javascript/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lifeoverflow.gitbook.io/learning-javascript/javascript-es5-jiao-xue/es5-zhong-de-zi-ding-wu-jian-lei-xing-prototype.md).

# ES5中的自訂物件類型-prototype

## 非自建物件類型的, 即`var obj ={};`, 可參考上一個章節的Object Literal Notation

## ES5, 自建物件類型的method宣告方式 以及static method/data:

物件的member成員若是function, 通常叫做method.

**非static method:** 1. `Person.prototype.sayHello = function()` 2. in constructor:

```javascript
    function Person (){  
      this.someData = 0;  
      this.testFun = function{  
        //can use this.someData to access
      }
    }
```

**static method:** `MyClass.method1 = function ()`. It has no relationship with an object instance of that constructor function <http://ithelp.ithome.com.tw/question/10128721>

**static property** 也可以透過一樣方式定義:`MyClass.staticProperty1 = "test"`

jQuery的library應該主要部份是純function, 部份是static method. e.g. `$('.jQueryButton')` 跟 `$.get()`


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://lifeoverflow.gitbook.io/learning-javascript/javascript-es5-jiao-xue/es5-zhong-de-zi-ding-wu-jian-lei-xing-prototype.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
