Skip to content

Commit 7bba0f0

Browse files
committed
Implement toUpperSnakeCase function to convert strings to UPPER_SNAKE_CASE
1 parent a3583cf commit 7bba0f0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,8 @@
1515
// Use the MDN string documentation to help you find a solution
1616
// This might help https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase
1717

18-
18+
function toUpperSnakeCase(string) {
19+
return string.toUpperCase().replaceAll(" ", "_");
20+
}
21+
22+
console.log(toUpperSnakeCase("hello there")); // should return "HELLO_THERE"

0 commit comments

Comments
 (0)