diff --git a/snippets/stringToArrayOfWords.md b/snippets/stringToArrayOfWords.md index 5cc742c60..851f93397 100644 --- a/snippets/stringToArrayOfWords.md +++ b/snippets/stringToArrayOfWords.md @@ -2,7 +2,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 string to array with the space a delimiter. +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 =>{ @@ -11,4 +11,5 @@ const stringToArray = str =>{ } // stringToArrayOfWords("I love javaScript!!") -> ["I", "love", "javaScript"] +// stringToArrayOfWords("python, javaScript & coffee") -> ["python", "javaScript", "coffee"] ``` \ No newline at end of file