> ## 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.array

> สร้าง new table ที่ถูก mark เป็น JSON array สำหรับ json.encode และคัดลอก sequence 1.#source เมื่อมี source table

<div className="real-function-page">
  ```lua theme={null}
  json.array(source?: table): table
  ```

  ## Arguments

  <ParamField path={"source"} type={"table"}>
    Optional source table. เมื่อไม่ใส่หรือเป็น nil, json.array จะคืน new empty array-marked table. เมื่อใส่ค่า จะคัดลอกเฉพาะ numeric sequence entries จาก 1 with #source ไปยัง new table.
  </ParamField>

  ## Returns

  <ResponseField name={"array"} type={"table"}>
    New table พร้อม JSON array marker. json.encode จะ serializes เป็น JSON array; original source table จะไม่ถูกคืนกลับ.
  </ResponseField>

  ## ตัวอย่าง

  สร้าง array-marked copy เพื่อให้ json.encode serializes ค่าเป็น JSON array.

  ```lua theme={null}
  local tags = json.array({ "api", "docs", "luau" })
  local empty = json.array()

  print(json.encode(tags))
  print(json.encode(empty))
  print(json.type(empty))
  ```
</div>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.