Skip to main content

参数

table
Optional source table。省略或为 nil 时,json.array 返回 new empty array-marked table。提供时,只会把 1 with #source 的 numeric sequence entries 复制到 new table。

返回值

table
带有 JSON array marker 的 new table。json.encode 会将其 serializes 为 JSON array;不会返回 original source table。

示例

创建 array-marked copy,让 json.encode 将该值 serializes 为 JSON array。