Fix typo to fit the context Fix typo add space Fix small typo Fix small typo Fix typo Fix typo Fix typo Fix typo Fix typo Fix typo Fix typo Update tail.md Fix typo Fix small typo Fix typo Fix typo Fix typo Fix typo Fix small typo Fix typo Fix small typo Fix typo Fix typo Fix typo Fix typo Fix typo Fix typo Fix typo Fix typo Fix typo
12 lines
286 B
Markdown
12 lines
286 B
Markdown
### countVowels
|
|
|
|
Retuns `number` of vowels in provided string.
|
|
|
|
Use a regular expression to count the number of vowels `(A, E, I, O, U)` in a `string`.
|
|
|
|
```js
|
|
const countVowels = str => (str.match(/[aeiou]/ig) || []).length;
|
|
// countVowels('foobar') -> 3
|
|
// countVowels('gym') -> 0
|
|
```
|