Skip to main content

Arguments

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

Returns

table
New table พร้อม JSON array marker. json.encode จะ serializes เป็น JSON array; original source table จะไม่ถูกคืนกลับ.

ตัวอย่าง

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