在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
This lesson introduces the We'll contrast the
type SerializationOptions = { formatting?: { indent?: number; }; }; function serializeJSON(value: any, options?: SerializationOptions) { const indent = options?.formatting?.indent ?? 2; return JSON.stringify(value, null, indent); } const user = { name: "Marius Schulz", twitter: "mariusschulz", }; const json = serializeJSON(user, { formatting: { indent: 0, }, }); console.log(json);
|
请发表评论