This is a theoretical question. Just wondering why the following is a valid JSON
[12,"json",true]
There is any answer about that?
THat's a JSON array. According to the latest specification, all of the following are valid JSON (1 per line):
123
"string"
null
true
false
["array item 1", 123]
{ "property": "value" }
From json.org
An array is an ordered collection of values. An array begins with [ (left bracket) and ends with ] (right bracket). Values are separated by , (comma).
A value can be a string in double quotes, or a number, or true or false or null, or an object or an array. These structures can be nested.
Hence [12,"json",true] is a valid json.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With