---
description: data structure indexed by string.
---

# associated array

[JS](..) ⟩ [concept](../../browser/concepts) ⟩ associated array

{% hint style="success" %}
:u6307: synonyms： "<mark style="color:purple;">**hash**</mark>", "<mark style="color:purple;">**map**</mark>", "<mark style="color:purple;">**dictionary**</mark>"

a [data](../../appendix/data "mention") <mark style="color:yellow;">**indexed**</mark> by [str](../val/prim/str "mention").

```javascript
{ name: 'Joy', age: 17 }
```
{% endhint %}

{% tabs %}
{% tab title="👥 相關" %}
* <mark style="color:yellow;">**JS**</mark> [obj](../val/obj "mention") <mark style="color:yellow;">**is**</mark> <mark style="color:purple;">**associated array**</mark>.
* [map](../val/builtin/map "mention") is now a <mark style="color:yellow;">**better alternative**</mark> for <mark style="color:purple;">**associated arrays**</mark>.
* [bracket-notation](../val/obj/prop/access/bracket-notation "mention") is a dynamic way to access <mark style="color:purple;">**associated arrays.**</mark>
{% endtab %}

{% tab title="📗 參考" %}
* [ ] [javascript-the-definitive-guide](../../master/ref/javascript-the-definitive-guide "mention") ⟩ 6.3 ⟩ Associated Arrays
{% endtab %}
{% endtabs %}
