---
description: 🚧 under construction
---

# serializing objects

[JS](../../..) ⟩ [value](../..) ⟩ [object](..) ⟩ serialize

{% hint style="success" %}
<mark style="color:red;">**convert**</mark>**/**<mark style="color:green;">**restore**</mark> an [**object**](..)'s <mark style="color:yellow;">**state**</mark> <mark style="color:red;">**to**</mark>/<mark style="color:green;">**from**</mark> a <mark style="color:yellow;">**string**</mark>.

```javascript
JSON.stringify(value, [replacer], [space])    // value -> string
JSON.parse(text, [reviver])                   // string -> value
```
{% endhint %}

{% tabs %}
{% tab title="👥 相關" %}
* [](<> "mention")
{% endtab %}

{% tab title="📗 參考" %}
* [ ] [javascript-the-definitive-guide](../../../../master/ref/javascript-the-definitive-guide "mention") ⟩&#x20;
  * [ ] 6.8 Serializing Objects
  * [ ] 11.6 JSON Serialization & Parsing
{% endtab %}

{% tab title="📘 手冊" %}
* [JSON.stringify()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify)
* [JSON.parse()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse)
{% endtab %}
{% endtabs %}
