freeCodeCamp/guide/chinese/javascript/standard-objects/json/index.md

23 lines
662 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

---
title: JSON
localeTitle: JSON
---
JavaScript Object Notation或`JSON`使用JavaScript对象的格式来存储数据。 JSON非常灵活因为它允许`Data Structures`具有`strings` `numbers` `booleans` `arrays`和`objects`任意组合。
以下是JSON对象的示例
```
var ourMusic = [
{
"artist": "Daft Punk",
"title": "Homework",
"release_year": 1997,
"formats": [
"CD",
"Cassette",
"LP" ],
"gold": true
}
];
```
这是一个对象数组,该对象包含有关相册的各种`metadata` 。它还有一个嵌套`formats`数组。其他专辑记录可以添加到顶级数组。