Skip to main content

Đối số

any
bắt buộc
Value de encode va decode. Supported JSON values round-trip qua JSON; unsupported types duoc encode thanh null tru khi encode options yeu cau error.
EncodeOptions
Optional encode options duoc truyen vao encode step, nhu sortKeys, emptyTableAsArray, errorOnUnsupported, encodeInvalidNumbersAsNull, maxDepth, pretty va indent.

Giá trị trả về

any
Decoded value duoc tao tu encoded JSON. Objects va arrays la new tables voi JSON kind markers tu decoder; JSON null values tro thanh json.null.

Kiểu

EncodeOptions

Kiểm soát việc tuần tự hóa và định dạng JSON.

Ví dụ

Round-trip JSON-compatible value qua json.encode va json.decode truoc khi thay doi nested values.