• Post author:
  • Post category:Blog
  • Reading time:2 mins read
  • Post last modified:June 12, 2024

What are two syntax rules for writing a JSON array? (Choose two.)

  • Each value in the array is separated by a comma.
  • A semicolon separates the key and list of values.
  • The array can include only one value type.
  • Values are enclosed in square brackets.
  • A space must separate each value in the array.
Explanation & Hint:

When writing a JSON array, the following two syntax rules apply:

  1. Each value in the array is separated by a comma.
  2. Values are enclosed in square brackets.

To clarify further:

  • Values within a JSON array are separated by commas. This is how the array denotes the end of one value and the beginning of another.
  • A JSON array is always enclosed in square brackets []. This is the fundamental syntax that defines the start and end of an array in JSON.

The other statements are incorrect based on JSON syntax rules:

  • A semicolon separates the key and list of values. This is incorrect. In JSON, a colon separates keys from their values within objects, not arrays. And in arrays, there are no keys, just a list of values.
  • The array can include only one value type. This is incorrect. A JSON array can include multiple value types; for example, it can contain strings, numbers, objects, arrays, booleans, and nulls all in the same array.
  • A space must separate each value in the array. This is incorrect. While spaces can improve readability, they are not required by JSON syntax. Values can be separated by commas without spaces, and JSON parsers will still be able to read the data correctly.

For more Questions and Answers:

CCNA 3 v7 – ENSA v7.02 Final Exam Answers Full 100%

Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments