7 lines
156 B
JavaScript
7 lines
156 B
JavaScript
function alphabetize_string(str)
|
|
{
|
|
|
|
return str.split('').sort().join('').trim();
|
|
|
|
}
|
|
console.log(alphabetize_string('United States')); |