Skip to content

Commit 066a39e

Browse files
authored
Prevent uncaught type error for empty string
Commented out code to prevent uncaught type error for empty strings.
1 parent a57ec22 commit 066a39e

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

  • Sprint-2/1-key-errors

Sprint-2/1-key-errors/0.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@ function capitalise(str) {
1212
// =============> write your explanation here
1313
// =============> write your new code here
1414
// [ChunYanWong]The uncaught type error will occur if the string is empty
15+
// if (str.length > 0) {
16+
// let str = ...
17+
//

0 commit comments

Comments
 (0)