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 61b4f71 commit 302855cCopy full SHA for 302855c
Sprint-2/3-mandatory-implement/2-cases.js
@@ -10,6 +10,16 @@
10
// it returns the string in UPPER_SNAKE_CASE, so "HELLO_THERE"
11
12
// Another example: "lord of the rings" should be "LORD_OF_THE_RINGS"
13
+function toUpperSnakeCase(str) {
14
+
15
+ const withUnderscores = str.replace(/ /g, "_");
16
17
+ const upperSnake = withUnderscores.toUpperCase();
18
19
+ return upperSnake;
20
+}
21
+console.log(toUpperSnakeCase("hello there"));
22
+console.log(toUpperSnakeCase("lord of the rings"));
23
24
// You will need to come up with an appropriate name for the function
25
// Use the MDN string documentation to help you find a solution
0 commit comments