- Version: v7.9.0
- Platform: Windows 10 (64-bit)
- Subsystem: none
The following code will print ["矮", "笨", "吃", "a", "b", "c"] in a uptodate browser, which is expected. But nodejs will print ["a", "b", "c", "吃", "矮", "笨"] for the same code, which is not reasonable for chinese users.
console.log(['矮', '吃', '笨', 'a', 'c', 'b'].sort((a, b) => a.localeCompare(b, 'zh-Hans-CN')))
Hope the String::localeCompare() function can be supported better, this is very useful for non-english-speaking users. thx :)
The following code will print
["矮", "笨", "吃", "a", "b", "c"]in a uptodate browser, which is expected. But nodejs will print["a", "b", "c", "吃", "矮", "笨"]for the same code, which is not reasonable for chinese users.Hope the String::localeCompare() function can be supported better, this is very useful for non-english-speaking users. thx :)