SoFunction
Updated on 2025-02-28

JavaScript sorts Chinese code according to pinyin

Today, I used the Chinese sorting according to pinyin in the code. After consulting the masters in the group, I got the following code:

var arr = ["Zhang San","Li Si","Wang Wu","Asan"]; 
(arr+"<br/>"); 
(function(a,b){ 
return (b); 
}); 
(arr);