Skip to content

Commit 4b5f054

Browse files
Finished cases JS
1 parent 081abeb commit 4b5f054

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎Sprint-3/3-mandatory-implement/2-cases.js‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
// Given a string input like "hello there"
99
// When we call this function with the input string
1010
// it returns the string in UPPER_SNAKE_CASE, so "HELLO_THERE"
11+
function toUpperSnakeCase(str) {
12+
return str.replace(/ /g, "_").toUpperCase();
13+
}
1114

1215
// Another example: "lord of the rings" should be "LORD_OF_THE_RINGS"
1316

0 commit comments

Comments
 (0)