function alphabet(str) { return str.split('').sort().reverse().join(''); } console.log(alphabet('htryuioadvcxswe'));