LoginSignup
10

More than 5 years have passed since last update.

JSONとJSオブジェクトの違い

Last updated at Posted at 2019-01-12

JSオブジェクト

キーをダブル、シングルコーテーションで囲っても囲わなくても良い & 文字列をダブル、シングルクォーテーションで囲む。(数字型の場合は囲わなくてOK)
{ 
    jsonId: 0,
    jsonName: "namename", ←末尾のカンマは使用できる。
}

JSON

キーをダブルクオーテーションで囲む & 文字列をダブルクォーテーションで囲む。 (数字型の場合は囲わなくてOK)
{ 
    "jsonId": 0,
    "jsonName": "namename" ←末尾のカンマは使用できない。
}

※JSONでは undefined が使えない。

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
10