We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3655b72 commit 9fec1a6Copy full SHA for 9fec1a6
src/Alphabet_Soup.js
@@ -0,0 +1,22 @@
1
+// Description: For this challenge you will be sorting characters in a string.
2
+
3
+// Q. Have the function AlphabetSoup(str) take the str string parameter being
4
+// passed and return the string with the letters in alphabetical order
5
+// (ie. hello becomes ehllo). Assume numbers and punctuation symbols will
6
+// not be included in the string.
7
8
+// Examples
9
+// Input: "coderbyte"
10
+// Output: bcdeeorty
11
12
+// Input: "hooplah"
13
+// Output: ahhloop
14
15
+const alphabetSoup = str => {
16
+ return str
17
+ .split('')
18
+ .sort()
19
+ .join('');
20
+};
21
22
+console.log(alphabetSoup('programming'));
0 commit comments