Cisco CCNA (200-301)Automation and ProgrammabilityEasy

A developer examines a JSON payload returned from a controller API and sees the following field: "vlan_ids": [10, 20, 30] What JSON data type is used to represent "vlan_ids"?

  1. AString
  2. BBoolean
  3. CObject
  4. DArray
Show answer & explanation

Correct answer: D. Array

An array in JSON is an ordered list of values enclosed in square brackets [ ]. The three numeric values 10, 20, and 30 are elements of that ordered list, making it an array rather than an object (which uses curly braces and key-value pairs).

Why the other options are wrong

  • A. Strings are single text values enclosed in quotes, not a list of numbers.
  • B. Booleans are true/false values, not numeric lists.
  • C. Objects use curly braces {} with key-value pairs, not square brackets.

JSON Array

A JSON array is an ordered, comma-separated collection of values enclosed in square brackets [ ], which can hold numbers, strings, objects, or other arrays.

  • Denoted by square brackets [ ]
  • Values are ordered and accessed by index
  • Can contain mixed data types including nested objects/arrays

Memory trick: Square brackets stack items like a list — that's an array.

More Automation and Programmability questions