split string and sort alphabetically
function sortString(str) {
const sort = str.split('').sort().join();
return sort.replace(/\$|,/g, '');
}
console.log(sortString('Grepper'));
Are there any code examples left?
New code examples in category Other