JavaScript:字符串内字母排序(升序和降序) var s = "kadfjkajfkhgofqnmvc"; console.log(Array.from(s).sort().join(""));//aacdfffghjjkkkmnoqv console.log(Array.from(s).sort().reverse().join(""));//aacdfffghjjkkkmnoqv JavaScript 2023-10-30 55 点赞 0 评论 83 浏览