JSON是JavaScript對象表示法,它是一種輕量級的數據交換格式。它由鍵值對組成,其中鍵名必須是字符串,而值可以是字符串、數字、數組、對象、布爾值或null。
{ "name": "Lucy", "age": 25, "hobbies": ["reading", "traveling", "hiking"], "address": { "city": "Shanghai", "country": "China" }, "isMarried": false, "nullValue": null }
Dress JSON是一種特殊類型的JSON文件,它與普通的JSON文件的區別在于在每個鍵值對之間都增加了一個“&&&”符號。
{ "name": "Lucy", "age": 25, "hobbies": ["reading", "traveling", "hiking"], "address": { "city": "Shanghai", "country": "China" }, "isMarried": false, "nullValue": null } &&& { "name": "Tom", "age": 30, "hobbies": ["swimming", "cooking", "photography"], "address": { "city": "Beijing", "country": "China" }, "isMarried": true, "nullValue": null }
在使用Dress JSON文件時,要注意每個鍵值對之間都需要增加“&&&”符號,否則會導致解析失敗。