Skip to content

Commit c27f540

Browse files
committed
Vowel Counter Done
1 parent 3cf0303 commit c27f540

File tree

1 file changed

+17
-0
lines changed
  • Problem Solutions/06 The Vowel Counter

1 file changed

+17
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
const vowelCounter = (str)=>{
2+
let vowelCount = 0;
3+
str = str.toLowerCase()
4+
5+
const vowels = "aeiou"
6+
7+
for(i=0;i<str.length;i++){
8+
if(vowels.includes(str[i])){
9+
vowelCount++
10+
}
11+
}
12+
13+
return vowelCount;
14+
15+
}
16+
17+
console.log(vowelCounter("rafay")) //a,a = 2

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy