Skip to content

Latest commit

 

History

History
9 lines (7 loc) · 163 Bytes

sorted.md

File metadata and controls

9 lines (7 loc) · 163 Bytes

String.prototype.sorted([compare])

Returns a string sorted alphabetically.

let str = "hello321";
let sr = str.sorted();
console.log(sr); // "123ehllo"