Skip to content

Commit

Permalink
Merge pull request #270 from tanishha/hacktober203
Browse files Browse the repository at this point in the history
create vowel.js
  • Loading branch information
fineanmol committed Oct 1, 2021
2 parents b273192 + 0acf834 commit e2c6598
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ const octal = (binary) => {
return parseInt(binary, 2).toString(8);
}

console.log(octal("1111000"));
console.log(octal("11110000")); //360
13 changes: 13 additions & 0 deletions Program's_Contributed_By_Contributors/JavaScript_Programs/vowel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const vowels = ['a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U'];

function countVowels(sentence) {
let counts = 0;
for (let i = 0; i < vowels.length; i++) {
if (vowels.includes(sentence[i])) {
counts++;
}
}
return console.log(counts);
}

countVowels('Hello World');

0 comments on commit e2c6598

Please sign in to comment.