> ## Documentation Index
> Fetch the complete documentation index at: https://docs.projectreal.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# json.type

> 返回值的 string type name。json.null 返回 "null"。table 使用与 json.isArray 和 json.isObject 相同的 table classification 返回 "array" 或 "object"。其他值返回 runtime Lua type name result。

<div className="real-function-page">
  ```lua theme={null}
  json.type(value: any): string
  ```

  ## 参数

  <ParamField path={"value"} type={"any"} required>
    要 classify 的值。传入 no value 会返回缺失 stack value 的 runtime type name。
  </ParamField>

  ## 返回值

  <ResponseField name={"jsonType"} type={"string"}>
    Type name string。已验证的 JSON-specific returns 是 "null"、"array" 和 "object"。non-table、non-json.null 值使用 Lua type name，例如 "nil"、"boolean"、"number"、"integer"、"string"、"function"、"object"、"thread"、"buffer"、"class"、"object"、"vector" 或 "no value"，取决于 runtime value。
  </ResponseField>

  ## 示例

  检查 JSON helper 返回的 exact type string。

  ```lua theme={null}
  print(json.type(json.array({ "red", "blue" })))
  print(json.type(json.object({ enabled = true })))
  print(json.type(json.null))
  print(json.type(nil))
  print(json.type())
  ```
</div>
