Represents a type that can be serialized to a JSON-compatible format.
This type includes primitive types (string, number, boolean, null), arrays, and objects with string keys whose values are serializable.
string
number
boolean
null
Note: undefined is not serializable to JSON and will be omitted in serialization.
undefined
const data: Serializable = { name: "John Doe", age: 30, isActive: true, tags: ["developer", "typescript"]}; Copy
const data: Serializable = { name: "John Doe", age: 30, isActive: true, tags: ["developer", "typescript"]};
Represents a type that can be serialized to a JSON-compatible format.
This type includes primitive types (
string,number,boolean,null), arrays, and objects with string keys whose values are serializable.Note:
undefinedis not serializable to JSON and will be omitted in serialization.