Bird
0
0

Which of the following is the correct syntax for a JSON array?

easy📝 Syntax Q3 of 15
Rest API - Request and Response Format
Which of the following is the correct syntax for a JSON array?
A{"items": (1, 2, 3)}
B{"items": {1, 2, 3}}
C{"items": [1, 2, 3]}
D{"items": <1, 2, 3>}
Step-by-Step Solution
Solution:
  1. Step 1: Recognize JSON array syntax

    JSON arrays use square brackets [] to hold ordered values.
  2. Step 2: Check each option's brackets

    Only {"items": [1, 2, 3]} uses square brackets correctly; others use parentheses, braces, or angle brackets incorrectly.
  3. Final Answer:

    {"items": [1, 2, 3]} -> Option C
  4. Quick Check:

    JSON array syntax = square brackets [OK]
Quick Trick: JSON arrays always use square brackets [] [OK]
Common Mistakes:
  • Using parentheses instead of brackets
  • Using curly braces for arrays
  • Using angle brackets mistakenly

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes