Skip to content

Gr1nchikJ/lab1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

lab1

Vowel Count

Difficulty Level: Easy

Link to the problem: Vowel Count - Codewars

Problem Description

Write a function that takes a string and returns the number of vowels (letters 'a', 'e', 'i', 'o', and 'u') in the string.

Example

function getCount(str) {
  let vowelsCount = 0;
  const vowels = ['a', 'e', 'i', 'o', 'u'];

  for (let char of str) {
    if (vowels.includes(char)) {
      vowelsCount++;
    }
  }

  return vowelsCount;
}

console.log(getCount('hello')); // 2

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published