Sorter factory function
Optional
A string with a BCP 47 language tag, or an array of such strings.
An object adjusting the output format.
const items = ['啊我', '波拉', 'abc', 0, 3, '10', ',11', 13, null, '阿吧', 'ABB', 'BDD', 'ACD', 'ä']items.sort( sorter('zh-Hans-CN', { ignorePunctuation: true, sensitivity: 'variant', numeric: true }))// [ 0, 3, "10", ",11", 13, "ä", "ABB", "abc", "ACD", "BDD", null, "阿吧", "啊我", "波拉" ] Copy
const items = ['啊我', '波拉', 'abc', 0, 3, '10', ',11', 13, null, '阿吧', 'ABB', 'BDD', 'ACD', 'ä']items.sort( sorter('zh-Hans-CN', { ignorePunctuation: true, sensitivity: 'variant', numeric: true }))// [ 0, 3, "10", ",11", 13, "ä", "ABB", "abc", "ACD", "BDD", null, "阿吧", "啊我", "波拉" ]
5.14.0
Sorter factory function