Guest User

Untitled

a guest
Sep 21st, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.20 KB | None | 0 0
  1. function vowels(str) {
  2.  
  3. let vowelCount = 0;
  4.  
  5. [...str].forEach((char, i) => {
  6. if (/[AEIOUaeiou]/.test(char) === true) {
  7. vowelCount += 1;
  8. }
  9. });
  10.  
  11. return vowelCount;
  12. }
Add Comment
Please, Sign In to add comment