Program JavaScript untuk Mengurutkan Kata dalam Urutan Abjad

Contoh: Mengurutkan Kata dalam Urutan Abjad // program to sort words in alphabetical order // take input const string = prompt(‘Enter a sentence: ‘); // converting to an array const words = string.split(‘ ‘); // sort the array elements words.sort(); // display the sorted words console.log(‘The sorted words are:’); for (const element of words) { […]

Read more »