Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
creator11-droid committed Oct 4, 2022
0 parents commit c9a38da
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions alg.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
let statement = 'The cost of living is paid in blood.'
let amount = statement.length
console.log(`lenght = ${amount}`)
let word = statement.split(' ')
const howManyWords = (word) =>{
let wordCount = 0;
for (const item in word){
wordCount++
}
console.log(`word count = ${wordCount}`)
}
howManyWords(word)
const vowelFrequency = (statement) => {
let frequency = ['a', 'e' , 'i', 'o', 'u']
let vowelCount= 0
for (const vowel of statement){
if(frequency.includes(vowel)){
vowelCount++
}
}
console.log(`vowel count = ${vowelCount}`)
}
vowelFrequency(statement)

0 comments on commit c9a38da

Please sign in to comment.