JSON Value

The data associated with a key in a JSON object or an element in an array. It can be a string, number, boolean, object, array, or null.

The value represents the actual data. The versatility of its allowed data types is what makes JSON so powerful for representing complex, structured information.

Valid JSON Value Types

  • String: Textual data, e.g., "hello".
  • Number: Integers or floating-point numbers, e.g., 101 or 3.14.
  • Boolean: Logical state, either true or false.
  • Object: A nested collection of key/value pairs, e.g., { "city": "New York" }.
  • Array: An ordered list of values, e.g., [1, 2, 3].
  • Null: Represents the intentional absence of a value, written as null.