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

30 lines
917 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 Arrays
localeTitle: JSON数组
---
## JSON数组
JSON数组与您在Javascript中使用的普通数组对象没有什么不同。它是一个包含多个`JSON Objects`的数组`JSON Objects` 。
以下是JSON数组的示例
```Javascript
var aMyPlaylist = [{
artist: "Ed Sheeran",
track: "Supermarket flowers",
myRating: 10
}, {
artist: "Tracy Chapman",
track: "Fastcar",
myRating: 9
}];
```
这是一个名为`aMyPlaylist`的JSON数组。所有数组方法如`map` `filter` `sort`也可以应用于任何JSON数组
#### 更多信息:
可以在以下链接中找到更多数组方法
* [数组 - Freecodecamp](https://guide.freecodecamp.org/javascript/standard-objects/array)
* [阵列 - Mozilla开发者网络](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)