Skip to content

Commit cbf5d1d

Browse files
committed
solve AlphabetSoup challenge
1 parent 9e8b68c commit cbf5d1d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Alphabet Soup renamed to alphabet_soup.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@
2020
* *
2121
***************************************************************************************/
2222

23-
function AlphabetSoup(str) {
23+
const AlphabetSoup = (str) => str?.toLowerCase()?.split("")?.sort()?.join("")
2424

25-
return str.split("").sort().join("");
26-
27-
}
25+
console.log(AlphabetSoup('jeelelllellre'))
26+
console.log(AlphabetSoup('AhmedMansour'))
27+
console.log(AlphabetSoup('Amans199'))
28+
console.log(AlphabetSoup('hello'))

0 commit comments

Comments
 (0)