# static member

[JS](/web/js.md) ⟩ [value](/web/js/val.md) ⟩ [object](/web/js/val/obj.md) ⟩ [class](/web/js/val/class.md) ⟩ [member](/web/js/val/class/member.md) ⟩ static

{% hint style="info" %}
🚧
{% endhint %}

{% hint style="warning" %}
In the context of [classes](/web/js/val/class.md), <mark style="color:yellow;">MDN Web Docs</mark> content uses the terms <mark style="color:yellow;">properties</mark> and [fields](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Public_class_fields) <mark style="color:yellow;">interchangeably</mark>.
{% endhint %}

{% tabs %}
{% tab title="💾 程式" %}
⭐️ static members

```javascript
class A {
  static a;                 // A.a = undefined
  static b = 0;             // A.b   (static property: initialized)
  static get c() { ... }    // A.c   (static getter)
  static d() { ... }        // A.d() (static method)
}
```

⭐️ private static members

{% hint style="warning" %}

* accessable <mark style="color:yellow;">only within the class body</mark>.
* private members are <mark style="color:yellow;">not inherited</mark>.
  {% endhint %}

```javascript
class A {
  // ⭐️ "#" means "private"
  static #e;                // A.#e    (private static property: uninitialized)
  static get #f() { ... }   // A.#f    (private static getter)
  static #g() { ... }       // A.#g()  (private static method)
}
```

{% endtab %}

{% tab title="📘 手冊" %}

* MDN ⟩ [JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript) ⟩ [Reference](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference) ⟩ [Classes](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes) ⟩ [static](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/static)
  {% endtab %}

{% tab title="📗 參考" %}

* [ ] [JS.info ⟩ class ⟩ Static properties and methods](https://javascript.info/static-properties-methods)
  {% endtab %}
  {% endtabs %}


---

# Agent Instructions: 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:

```
GET https://lochiwei.gitbook.io/web/js/val/class/member/static.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
