demand:
- an array Each element of the
- array is a string The
- string may be empty, that is,
""
- sort the array with special characters first and strings of length 0 first, that is, the example in requirement 3, followed by underscores. Other special strings can be sorted according to the built-in rules of JS .
followed by numbers (from small to big), uppercase letters, lowercase letters, and finally Chinese characters, alphabetical order, Chinese characters sorted by pinyin
give an example
let a = ["", "A001", "V002", "V003", "_123", "133", "2334", "a001", "v004", "", "", ""]
//
// a = ["", "_123", "133", "2334", "A001", "V002", "V003", "a001", "v004", "", "", ""]
PS:
I removed the mixed Chinese and English strings and felt that it would be more complicated