> For the complete documentation index, see [llms.txt](https://lochiwei.gitbook.io/web/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lochiwei.gitbook.io/web/js/val/class/member/static.md).

# 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 %}
