Skip to main content

Scalar Formats

  • 字符串的格式
    • stringify
    • parse
formatexample
Structure Data
JSON[],{},null
JSONObject{}
XML<tag>value</tag>
Primative
String"string"
Number1,1.1
Booleantrue,false
NULLnull
Undefinedundefined
Collection
Array/Set/Map[], {}
Temporal
Duration1h30m
Timestamp
DateTime2021-01-01T00:00:00Z
Date2021-01-01
Spec/Std
CountryCodeUS
CurrencyUSD
TimeZone/OffsetAsia/Shanghai, +08:00, CST, UTC+8
ID/Key
CUIDcjo2j3n4k0000z1zj1z1z1z1z
ULID01D3XZ6Z1E4QZQZQZQZQZQZQZQ
UUID550e8400-e29b-41d4-a716-446655440000
DIDdid:example:123456
LanguageCodeen
DeweyDecimal123.456
HexColor#ff0000
Hexadecimal0xff0000
ISBN978-3-16-148410-0
MD5d41d8cd98f00b204e9800998ecf8427e
Network
IPV41.1.1.1
IPV62001:0db8:85a3:0000:0000:8a2e:0370:7334
CIDR1.1.1.1/24
MAC00:11:22:33:44:55
URLhttps://example.com
URI
URNurn:isbn:0451450523
UserAgentMozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3