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().

Answer from Barmar on Stack Overflow
🌐
W3Schools
w3schools.com › js › js_json_server.asp
<h1>JavaScript Loading JSON</h1>
If the file contains a JSON array, response.json() returns a JavaScript array.
🌐
JSON Schema
json-schema.org › understanding-json-schema › reference › array
JSON Schema - array
In Python, "array" is analogous to the list or tuple type, depending on usage. However, the json module in the Python standard library will always use Python lists to represent JSON arrays.

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().

Answer from Barmar on Stack Overflow
Find elsewhere
🌐
JSON
json.org
JSON
JSON is a text format that is ... Perl, Python, and many others. These properties make JSON an ideal data-interchange language. ... A collection of name/value pairs. In various languages, this is realized as an object, record, struct, dictionary, hash table, keyed list, ...
🌐
JSON Formatter
jsonformatter.curiousconcept.com
JSON Formatter & Validator
The JSON Formatter & Validator beautifies and debugs JSON data with advanced formatting and validation algorithms.
🌐
JSON Formatter
jsonformatter.org
Best JSON Formatter and JSON Validator: Online JSON Formatter
Supports JSON Graph View of JSON String which works as JSON debugger or corrector and can format Array and Object.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Learn_web_development › Core › Scripting › JSON
Working with JSON - Learn web development | MDN
August 27, 2026 - Each property of an object must be in the form of "key": value. Property names must be string literals enclosed in double quotes. Special JavaScript syntax, such as methods, is not allowed because methods are functions, and functions are not valid JSON data types. Objects and arrays cannot contain trailing commas.
🌐
Stack Overflow
stackoverflow.blog › 2022 › 06 › 02 › a-beginners-guide-to-json-the-data-format-for-the-internet
A beginner's guide to JSON, the data format for the internet - Stack Overflow
June 2, 2022 - JSON is a human-readable format for storing and transmitting data. As the name implies, it was originally developed for JavaScript, but can be used in any language and is very popular in web applications.
🌐
Medium
medium.com › @apdharshi › difference-between-arrays-and-json-objects-fa1c8598f9f1
Difference between Arrays and JSON Objects | by APD | Medium
May 19, 2019 - Keys must be strings, and values must be a valid JSON data type (string, number, object, array, boolean or null). Format { “ ”: “ ” } Example {“position”: “winner”,”country”: “U.S.A”} { “binary”: [{“id”:1,”name”:0},{“id”:2,”name”:1}], “boolean”: [{“id”:1,”value”: false},{“id”:2,”value”: true}]} Nested Objects: “results”: { “tennis”: [ {“position”: “winner”,“country”: “U.S.A}, {“position”: “runner”,“country”: “China”} ]} JSON Objects are enclosed within {} “universe”: { “planets”: { “
🌐
Codefinity
codefinity.com › courses › v2 › d797f15f-39dd-4abc-8cfd-0d898dd2b885 › 372339e2-bcc5-490c-a5ee-f4d51f680045 › e304b41b-64c3-4141-9977-18b5c16467ff
Learn JSON Arrays and Nested Objects | Understanding JSON Data
JSON arrays allow you to group multiple items together using square brackets []. Each item inside a JSON array can be a simple value, such as a number or string, or a more complex object.
🌐
CodeSignal
codesignal.com › learn › courses › parsing-json-with-csharp › lessons › parsing-json-arrays-and-nested-structures
Parsing JSON Arrays and Nested Structures
Welcome to this lesson on parsing arrays within JSON structures using C#. As you've learned in previous lessons, JSON (JavaScript Object Notation) is a popular data format used for exchanging data, owing to its simplicity and readability. JSON arrays are crucial when it comes to representing collections of data elements, such as employee records in a company or products in an inventory.
🌐
SemanticDiff
semanticdiff.com › online-diff › json
SemanticDiff - Online JSON Diff
Additional rules are applied to filter out changes that do not modify the semantics of the values, such as reordering keys within the same object or using a different base to represent an integer literal (e.g. hex/decimal in JSON5).
🌐
JAXB
javaee.github.io › tutorial › jsonp001.html
Introduction to JSON
Objects are enclosed in braces ({}), their name-value pairs are separated by a comma (,), and the name and value in a pair are separated by a colon (:). Names in an object are strings, whereas values may be of any of the seven value types, including another object or an array.
🌐
Leapcell
leapcell.io › blog › understanding-json-arrays-a-practical-guide
Understanding JSON Arrays: A Practical Guide | Leapcell
July 25, 2025 - JSON (JavaScript Object Notation) ... generate. One of its fundamental structures is the array, which is widely used to represent ordered collections of data....
🌐
RestfulAPI
restfulapi.net › home › json › json array: syntax, nested arrays and examples
JSON Array - Multi-dimensional Array in JSON
3 weeks ago - RFC 8259, the standard that defines JSON, describes an array in a single line: square brackets around zero or more values, with commas between the values. Spaces, tabs and line breaks are allowed around the brackets and commas.
🌐
W3Schools
w3schools.com › js › js_json.asp
JavaScript JSON
JSON is a text format for storing and exchanging data.