We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 88ab77c commit 62d0b27Copy full SHA for 62d0b27
2 files changed
1-js/05-data-types/03-string/1-ucfirst/solution.md
@@ -6,7 +6,7 @@
6
let newStr = str[0].toUpperCase() + str.slice(1);
7
```
8
9
-存在一个小问题,如果 `str` 是空的,那么 `str[0]` 是 undefined,因此我们会得到一个错误。
+这里存在一个小问题。如果 `str` 是空的,那么 `str[0]` 就是 `undefined`,但由于 `undefined` 并没有 `toUpperCase()` 方法,因此我们会得到一个错误。
10
11
存在如下两种变体:
12
0 commit comments