---
description: 🚧 under construction
---

# static member

[JS](../../..) ⟩ [value](../..) ⟩ [object](../../obj) ⟩ [class](..) ⟩ [member]() ⟩ static

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

{% hint style="warning" %}
In the context of [classes](..), <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 %}
