3
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

JSONについて

Last updated at Posted at 2017-02-17

JSONとはたくさんのデータをまとめることができるデータフォーマット。

JSONを扱うには、オブジェクトリテラルの知識があったら助かる。

『人についてのデータ』を作ってみる。

{
"name":"石橋",
"age":19
"size":"L"
}

『複数人についてのデータ』
配列を使います。

{
"people":[
{
"name":"石橋",
"age":19
"size":"L"
},{
"name":"橘",
"age":19
"size":"S"
},{
"name":"森",
"age":19
"size":"L"
}]
}

データ取得方法は、
people[1].name で 橘 と表されます。
people[2].name で 森,
people[0].age で 19,
people[2].size で L ,
こんな感じ。

3
6
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?