split string and sort alphabetically code example
Example: split string and sort alphabetically
function sortString(str) {
const sort = str.split('').sort().join();
return sort.replace(/\$|,/g, '');
}
console.log(sortString('Grepper'));
function sortString(str) {
const sort = str.split('').sort().join();
return sort.replace(/\$|,/g, '');
}
console.log(sortString('Grepper'));