File tree Expand file tree Collapse file tree
Sprint-3/3-mandatory-implement Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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+ function toUpperSnakeCase ( inputString ) {
19+ // Split the input string into words using space as the delimiter
20+ const words = inputString . split ( ' ' ) ;
21+
22+ // Join the words with underscores and convert to uppercase
23+ const upperSnakeCaseString = words . join ( '_' ) . toUpperCase ( ) ;
24+
25+ return upperSnakeCaseString ;
26+ }
27+
28+
29+ console . log ( toUpperSnakeCase ( "hello there" ) ) ; // Output: "HELLO_THERE"
30+ console . log ( toUpperSnakeCase ( "lord of the rings" ) ) ; // Output: "LORD_OF_THE_RINGS"
You can’t perform that action at this time.
0 commit comments