Skip to content

Commit 1b05095

Browse files
authored
Update solution
1 parent 6bbe0b4 commit 1b05095

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

1-js/05-data-types/03-string/1-ucfirst/solution.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ But we can make a new string based on the existing one, with the uppercased firs
66
let newStr = str[0].toUpperCase() + str.slice(1);
77
```
88

9-
There's a small problem though. If `str` is empty, then `str[0]` is undefined, so we'll get an error.
9+
There's a small problem though. If `str` is empty, then `str[0]` is `undefined`, and as `undefined` doesn't have the `toUpperCase()` method, we'll get an error.
1010

1111
There are two variants here:
1212

0 commit comments

Comments
 (0)