JSON-Array
What is JSON? JSON_Syntax JSON_Data Types JSON_vs_XML JSON_Array JSON_Object
- Array in JSON is defined as the same as arrays in other programming languages.
- A JSON array is a collection of the ordered list of values that are represented within the square bracket( [ ]).
- In an array, each value is separated by a comma.
- The values must be any one of the JSON data types such as string, Boolean, object, number, and null.
JSON Array Example
The following table shows the examples of JSON array representation with different values.
Data types | JSON Array Examples |
---|---|
Number: JSON array stores number values | { "car_id" : [103,146,289,100] } |
String: JSON array stores string values | { "car_color":["Red","Blue","Black","Yellow","Pink"] } |
Boolean: JSON array stores boolean values | { [true,true,false,true] } |
Object: JSON array stores 3 object values | { "car":[ |
<< Previous - JSON JSON vs XML