I'll elaborate a bit more on ChrisR awesome answer and bring images from his awesome reference.
A valid JSON always starts with either curly braces { or square brackets [, nothing else.
{ will start an object:

{ "key": value, "another key": value }
Hint: although javascript accepts single quotes
', JSON only takes double ones".
[ will start an array:

[value, value]
Hint: spaces among elements are always ignored by any JSON parser.
And value is an object, array, string, number, bool or null:

So yeah, ["a", "b"] is a perfectly valid JSON, like you could try on the link Manish pointed.
Here are a few extra valid JSON examples, one per block:
{}
[0]
{"__comment": "json doesn't accept comments and you should not be commenting even in this way", "avoid!": "also, never add more than one key per line, like this"}
[{ "why":null} ]
{
"not true": [0, false],
"true": true,
"not null": [0, 1, false, true, {
"obj": null
}, "a string"]
}
Answer from cregox on Stack OverflowI'll elaborate a bit more on ChrisR awesome answer and bring images from his awesome reference.
A valid JSON always starts with either curly braces { or square brackets [, nothing else.
{ will start an object:

{ "key": value, "another key": value }
Hint: although javascript accepts single quotes
', JSON only takes double ones".
[ will start an array:

[value, value]
Hint: spaces among elements are always ignored by any JSON parser.
And value is an object, array, string, number, bool or null:

So yeah, ["a", "b"] is a perfectly valid JSON, like you could try on the link Manish pointed.
Here are a few extra valid JSON examples, one per block:
{}
[0]
{"__comment": "json doesn't accept comments and you should not be commenting even in this way", "avoid!": "also, never add more than one key per line, like this"}
[{ "why":null} ]
{
"not true": [0, false],
"true": true,
"not null": [0, 1, false, true, {
"obj": null
}, "a string"]
}
Your JSON object in this case is a list. JSON is almost always an object with attributes; a set of one or more key:value pairs, so you most likely see a dictionary:
{ "MyStringArray" : ["somestring1", "somestring2"] }
then you can ask for the value of "MyStringArray" and you would get back a list of two strings, "somestring1" and "somestring2".
How to write a simple array in json?
Can a JSON file start with an array instead of an object?
Problems in understand top-level-JSON-array
Hi guys, how do I loop through an array in json, and put values in another array using logstash?
Videos
The JSON for that array is:
["apple","orange","cat","dog"]
JSON for arrays is the same as Javascript array literals, except that JSON doesn't allow missing elements or an optional trailing comma. And the elements of the array have to be valid JSON, so you have to use double quotes around strings, you can't use single quotes like Javascript allows.
You generally shouldn't have to worry about how to format JSON yourself, most languages have library functions that do it for you. In JS you use JSON.stringify, in PHP you use json_encode().
You can convert the array into json by JSON.stringify
var array_list=['apple','orange','cat','dog'];
var json_string = JSON.stringify(array_list);
And using JSON.parse you can parse the JSON
var obj = JSON.parse(json_string);
DEMO
It's been my experience that most if not all of them start with a curly brace. I've been looking into json decoding/encoding in Python, and it got me wondering if a json file could start with a square bracket instead.