update snippets 0-All

This commit is contained in:
Stefan Feješ
2017-12-25 14:49:52 +01:00
committed by Agamemnon Zorbas
parent 6bedb8fba4
commit 0c129cdd02
33 changed files with 166 additions and 74 deletions

View File

@ -7,6 +7,9 @@ Omit the second argument to use the default regex.
```js
const words = (str, pattern = /[^a-zA-Z-]+/) => str.split(pattern).filter(Boolean);
// words("I love javaScript!!") -> ["I", "love", "javaScript"]
// words("python, javaScript & coffee") -> ["python", "javaScript", "coffee"]
```
```js
words("I love javaScript!!") -> ["I", "love", "javaScript"]
words("python, javaScript & coffee") -> ["python", "javaScript", "coffee"]
```