How Do You Represent a Json Array of Strings?

How Do You Represent a Json Array of Strings?

This is all you need for valid JSON, right?

["somestring1", "somestring2"]
4

4 Answers

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 ".

James H. Sterling
Author

James H. Sterling

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.