0
1

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 1 year has passed since last update.

JSONのオブジェクトと配列

Last updated at Posted at 2022-08-30

概要

  • JSONのオブジェクトと配列について簡単にまとめる。

前提

  • 下記を用いてJSONの構文が誤っていないことを確認した

配列

  • []で囲まれた中に値を列挙することで定義する事ができる。

    [
      "foo", 
      "var"
    ]
    

オブジェクト

  • {}で囲まれた中に"key": "value"の形式で値を格納することで定義する事ができる。

    {
      "id": 1,
      "name": "miriwo"
    }
    
  • オブジェクトの中にオブジェクトを格納することもできる。

    {
      "id": 1,
      "name": "miriwo",
      "other": {
        "id": 1,
        "string": "foo"
      }
    }
    
  • オブジェクトの中に配列を格納することもできる。

    {
      "id": 1,
      "name": "miriwo",
      "string": [
        "foo",
        "var"
      ]
    }
    
0
1
0

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
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?