Skip to content

Commit cf2bf33

Browse files
author
AlanGit-debug2604
committed
3-mandatory-implement 2-cases.js Implemented upperSnakeCase function to convert strings to UPPER_SNAKE_CASE format
1 parent 6be655b commit cf2bf33

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,14 @@
1414
// You will need to come up with an appropriate name for the function
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
17+
18+
//pseudocode draft below
19+
//Name of function upperSnakeCase
20+
//Parameter (userInputString) type: String
21+
//Method .toUpperCase() .replaceAll("","_")
22+
//print by console.log (`${userInputString()`})
23+
24+
function upperSnakeCase(userInputString) {
25+
return userInputString.toUpperCase().replaceAll(" ", "_");
26+
}
27+
console.log(upperSnakeCase("hello world"));

0 commit comments

Comments
 (0)