JavaScript program to sort words in an alphabetical order:
function sortWords(str) {
return str.split(" ").sort().join(" ");
}
console.log(sortWords("javascript is awesome"));
JavaScript program to sort words in an alphabetical order:
function sortWords(str) {
return str.split(" ").sort().join(" ");
}
console.log(sortWords("javascript is awesome"));
© 2024 python tutorials. python-tutorials.in