diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 000000000..940c318b4
--- /dev/null
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,20 @@
+
+
+
+
+## Description
+
+**Resolves** #(issue number)
+
+## Types of changes
+- [ ] Bug fix (non-breaking change which fixes an issue)
+- [ ] New feature (non-breaking change which adds functionality)
+- [ ] Breaking change (fix or feature that would cause existing functionality to change)
+
+## Checklist:
+
+- [ ] My code follows the code style of this project.
+- [ ] My change requires a change to the documentation.
+- [ ] I have updated the documentation accordingly.
+- [ ] I have checked that there isn't any PR doing the same
+- [ ] I have read the **CONTRIBUTING** document.
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 4b1164232..ac39ceccc 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -24,7 +24,7 @@ Here's what you can do to help:
- Follow snippet descriptions with an empty line.
- **Snippet code** must be enclosed inside ` ```js ` and ` ``` `.
- Remember to start your snippet's code on a new line below the opening backticks.
- - Use ES6 notation to define your function. For example `const myFunction = arg1, arg2 => { }`.
+ - Use ES6 notation to define your function. For example `const myFunction = ( arg1, arg2 ) => { }`.
- Try to keep your snippets' code short and to the point. Use modern techniques and features. Make sure to test your code before submitting.
- All snippets must be followed by one (more if necessary) test case after the code, on a new line, in the form of a comment, along with the expected output. The syntax for this is `myFunction('testInput') -> 'testOutput'`. Use multiline comments only if necessary.
- Try to make your function name unique, so that it does not conflict with existing snippets.
@@ -57,7 +57,7 @@ Here's what you can do to help:
- Use `()` if your function takes no arguments.
- Use `_` if an argument inside some function (e.g. `Array.reduce()`) is not used anywhere in your code.
- Specify default parameters for arguments, if necessary. It is preferred to put default parameters last unless you have pretty good reason not to.
-- If your snippet's function takes variadic arguments, use `..args` (although in certain cases, it might be needed to use a different name).
+- If your snippet's function takes variadic arguments, use `...args` (although in certain cases, it might be needed to use a different name).
- If your snippet function's body is a single statement, omit the `return` keyword and use an expression instead.
- Always use soft tabs (2 spaces), never hard tabs.
- Omit curly braces (`{` and `}`) whenever possible.
diff --git a/README.md b/README.md
index c4a6765d3..c13cf2fad 100644
--- a/README.md
+++ b/README.md
@@ -110,6 +110,7 @@
* [`anagrams`](#anagrams)
* [`capitalize`](#capitalize)
* [`capitalizeEveryWord`](#capitalizeeveryword)
+* [`countVowels`](#countvowels)
* [`escapeRegExp`](#escaperegexp)
* [`fromCamelCase`](#fromcamelcase)
* [`reverseString`](#reversestring)
@@ -251,12 +252,12 @@ const distinctValuesOfArray = arr => [...new Set(arr)];
Removes elements in an array until the passed function returns `true`. Returns the remaining elements in the array.
-Loop through the array, using `Array.shift()` to drop the first element of the array until the returned value from the function is `true`.
+Loop through the array, using `Array.slice()` to drop the first element of the array until the returned value from the function is `true`.
Returns the remaining elements.
```js
const dropElements = (arr, func) => {
- while (arr.length > 0 && !func(arr[0])) arr.shift();
+ while (arr.length > 0 && !func(arr[0])) arr = arr.slice(1);
return arr;
};
// dropElements([1, 2, 3, 4], n => n >= 3) -> [3,4]
@@ -1452,6 +1453,21 @@ const capitalizeEveryWord = str => str.replace(/\b[a-z]/g, char => char.toUpperC
[⬆ back to top](#table-of-contents)
+### countVowels
+
+Retuns `number` of vowels in provided string.
+
+Use a regular expression to count number of vowels `(A, E, I, O, U)` in a `string`.
+
+```js
+const countVowels = str =>
+ return (str.match(/[aeiou]/ig) || []).length;
+// countVowels('foobar') -> 3
+// countVowels('gym') -> 0
+```
+
+[⬆ back to top](#table-of-contents)
+
### escapeRegExp
Escapes a string to use in a regular expression.
diff --git a/docs/index.html b/docs/index.html
index 7c2e08821..d0c93846e 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -22,11 +22,13 @@