Fixed typo and added another example

This commit is contained in:
Arjun Mahishi
2017-12-20 00:28:34 +05:30
parent b718627989
commit a4d9656df1

View File

@ -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"]
```