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 3ba023b commit 3d61c7fCopy full SHA for 3d61c7f
Sprint-2/3-mandatory-implement/2-cases.js
@@ -14,3 +14,19 @@
14
// You will need to come up with an appropriate name for the function
15
// Use the MDN string documentation to help you find a solution
16
// This might help https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase
17
+
18
19
+function capSnakeCase(str) {
20
21
+ const upper = str.toUpperCase();
22
+ const snake = upper.replace(/ /g, "_");
23
24
+ return snake;
25
+}
26
27
+console.log(capSnakeCase("lord of the rings"));
28
29
+// Step-1 ----> Get a string
30
+// Step-2 ----> change to upper case
31
+// Step-3 ----> Replace space with underscore
32
+// Step-4 ----> Return capSnakeCase
0 commit comments