var s = "hello world!";var s1 = Array.prototype.sort.call(s,function(a,b){ return a.charCodeAt(0) - b.charCodeAt(0);});//(a,b)=>(a.charCodeAt(0) - b.charCodeAt(0))這里的s不能直接調用數組的sort()方法的原因是啥?
js 對一個字符串根據ASCII編碼排序
滄海一幻覺
2018-12-20 18:14:13