From 282bf85f4fcf94c6019919569ffd9f0d63d0c306 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Tue, 12 Dec 2017 11:16:47 +0200 Subject: [PATCH] Build README --- README.md | 4 ++-- snippets/capitalize-first-letter.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a9919919b..16a5dd1e1 100644 --- a/README.md +++ b/README.md @@ -74,10 +74,10 @@ var average = arr => ### Capitalize first letter -Use `toUpperCase()` to capitalize first letter, `slice(1)` to get the rest of the string. +Use `sice(0,1)` and `toUpperCase()` to capitalize first letter, `slice(1)` to get the rest of the string. ```js -var capitalize = str => str[0].toUpperCase() + str.slice(1); +var capitalize = str => str.slice(0, 1).toUpperCase() + str.slice(1); ``` ### Count occurrences of a value in array diff --git a/snippets/capitalize-first-letter.md b/snippets/capitalize-first-letter.md index 84447ee21..1310e76ed 100644 --- a/snippets/capitalize-first-letter.md +++ b/snippets/capitalize-first-letter.md @@ -1,6 +1,6 @@ ### Capitalize first letter -Use `toUpperCase()` to capitalize first letter, `slice(1)` to get the rest of the string. +Use `sice(0,1)` and `toUpperCase()` to capitalize first letter, `slice(1)` to get the rest of the string. ```js var capitalize = str => str.slice(0, 1).toUpperCase() + str.slice(1);