Skip to content

Commit eb2169e

Browse files
change " " to / /g
1 parent 31e4589 commit eb2169e

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@
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
function toUpperSnakeCase(text) {
18-
const newText = text.replace(" ", "_");
18+
const newText = text.replace(/ /g, "_");
1919
return newText.toUpperCase();
2020
}
2121
console.log(
2222
`The upper snake case of "hello there" is ${toUpperSnakeCase("hello there")}`,
2323
);
24+
console.log(
25+
`The upper snake case of "lord of rings" is ${toUpperSnakeCase("lord of the rings")}`,
26+
);

0 commit comments

Comments
 (0)