You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 1-js/05-data-types/03-string/1-ucfirst/solution.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ But we can make a new string based on the existing one, with the uppercased firs
6
6
let newStr = str[0].toUpperCase() +str.slice(1);
7
7
```
8
8
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.
0 commit comments