Skip to content

Intl.ListFormat 和 Intl.DataTimeFormat

Intl.ListFormat

语言相关的列表格式化构造器,主要用于格式化数组类型的数据。

语法

js
const list = ["张三", "李四", "王五", "赵六"]

new Intl.ListFormat("zh_CN", { style: 'long', type: 'conjunction' }).format(list))