> For the complete documentation index, see [llms.txt](https://jen-hsuan-hsieh.gitbook.io/javascript-node-js/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jen-hsuan-hsieh.gitbook.io/javascript-node-js/chapter1/12javascript-quan-gong-lve-ff1a-ke-fu-js-de-qi-guai-bu-fen/123wu-jian-yu-han-shu/1234json-yu-wu-jian-shi-ti.md).

# 1.2.3.4.JSON 與物件實體

* JSON: JavaScript Object Notation
  * object literal的子集合, 屬性一定要包在雙引號中
* 網路傳輸資料時的格式

```
var objectLiteral = {
    firstname : 'Mary',
    isAProgramer: true
}

//物件轉為JSON字串
console.log(JSON.stringify(objectLiteral))

//JSON
var JsonValue = JSON.parse('{
    "firstname" : 'Mary',
    "isAProgramer": true
}');


//JSON字串轉為物件
console.log(JsonValue)
```
