Skip to content

Commit 5c917cf

Browse files
committed
Refactor toUpperSnakeCase function for improved readability
1 parent 910470b commit 5c917cf

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ function toUpperSnakeCase(input){
1919
if (typeof input !== "string"){
2020
throw new Error("Input must be a string")
2121
}
22-
return input.trim().replaceAll(/\s+/g, "_").toUpperCase();
22+
return input.trim()
23+
.replaceAll(/\s+/g, "_")
24+
.toUpperCase();
2325
}
2426
console.log (toUpperSnakeCase("lord of the rings season 1 episode 1"));

0 commit comments

Comments
 (0)