Reputation: 329
Can a JSON object hold a JSON array as is shown in the following code?
courseJSONObject.put( "students", studentJSONArray );
Upvotes: 0
Views: 507
Reputation: 1075209
Yes, it looks like this:
{
"students": []
}
For example, here's an object with a students
array containing the entries 1, 2, and 3:
{
"students": [1, 2, 3]
}
More in the documentation and the RFC.
Upvotes: 1