From 1b05095b1749cb1d45c9b602f3c78f19334a5bd5 Mon Sep 17 00:00:00 2001 From: aruseni Date: Mon, 1 Jul 2019 06:03:30 +0300 Subject: [PATCH] Update solution --- 1-js/05-data-types/03-string/1-ucfirst/solution.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-js/05-data-types/03-string/1-ucfirst/solution.md b/1-js/05-data-types/03-string/1-ucfirst/solution.md index 527d3978..f7a332d0 100644 --- a/1-js/05-data-types/03-string/1-ucfirst/solution.md +++ b/1-js/05-data-types/03-string/1-ucfirst/solution.md @@ -6,7 +6,7 @@ But we can make a new string based on the existing one, with the uppercased firs let newStr = str[0].toUpperCase() + str.slice(1); ``` -There's a small problem though. If `str` is empty, then `str[0]` is undefined, so we'll get an error. +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. There are two variants here: