标签:
var city = ["北京","天津","上海","重庆","杭州"];city.sort(function compareFunction(a,b){ return a.localeCompare(b); }); console.log(city); ==>["北京", "重庆", "杭州", "上海", "天津"]
js对汉字首字母排序
原文地址:http://www.cnblogs.com/chengkun101/p/4934015.html