JSON Array

Arrays in JSON are used to store a list of primitive or complex objects. JSON arrays can store different types of elements: strings, numbers, booleans, objects, and multidimensional arrays. The values of a JSON array are separated by commas. Array elements can be accessed by using the "[]" operator. Unlike dictionaries, where you can get the value by its key, in a JSON array, the array elements can only be accessed by their index. The following is an example of a JSON array with numbers. Below, you can find a list of JSON arrays with different data types.

JSON

XML Comments Summary
  • JSON arrays are used to store a list of primitive or complex objects
  • Arrays in JSON can store a variety of elements, including strings, numbers, booleans, objects, and multidimensional arrays
  • JSON array values separated by commas
  • Array values are accessed using the "[]" operator
  • In a JSON array, array elements can only be accessed by their index
Trusted by 850,000+ API Developers