From 7d8f1c97e31bf6af98c9888b2f966f51da414343 Mon Sep 17 00:00:00 2001 From: Arjun Mahishi Date: Wed, 20 Dec 2017 00:30:10 +0530 Subject: [PATCH] Fixed function name --- snippets/stringToArrayOfWords.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/stringToArrayOfWords.md b/snippets/stringToArrayOfWords.md index 851f93397..c54e2cec4 100644 --- a/snippets/stringToArrayOfWords.md +++ b/snippets/stringToArrayOfWords.md @@ -5,7 +5,7 @@ Converts a given string into an array of words First create an array of dirt that you want to remove from the string. Then replace each dirt with an empty string. Use `String.split(' ')` to conver the string to an array with the space as a delimiter. ```js -const stringToArray = str =>{ +const stringToArrayOfWords = str =>{ [".", ",", "?", "!", "& ", "(", ")", "[", "]"].map(d => str = str.replace(d, "")); return str.split(" "); }