0
0

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

Posted at

JSON

JavaScript Object Notationのこと
データを表現するための軽量で簡潔なデータ形式
JavaScriptのオブジェクト記法に基づいていて、多くのプログラミング言語でサポートされてる

JSONの特徴

テキストベースのデータ形式

  • 人間が読み書きしやすい
  • プログラム間でデータをやり取りするのに適している

キーバリューのペア

  • キー : 文字列(ダブルクォートで囲まれたテキスト)が使用できる
  • 値 : 文字列、数値、真偽値、配列、ネストされたオブジェクトなどのデータ型が使用できる
    ☆JSONはキーバリューのペアを使ってデータを表現する

配列

  • 配列は角括弧 [ ] で表現する
    ☆JSONは複数の値を順序付けて格納するための配列をサポートする

JSONの例(人物の情報を表現)


{
  "name": "David",
  "age": 32,
  "isMarried": false,
  "hobbies": ["reading", "swimming", "coding"],
  "address": {
    "city": "New York",
    "zipCode": "10001"
  }
}

キーバリューのペアで名前や年齢、結婚状態などの属性を持っている
hobbiesとaddressは配列とネストされたオブジェクトを含んでいる

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?