Practice Real Company Assessment Patterns • Latest 2025–2026 Mock Tests

Programming Exercises

Create a function to count the number of vowels in a given string.

Easy

Problem Statement

Create a function to count the number of vowels in a given string.

Sample Input

"hello"

Sample Output

2

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
// Count the number of vowels in a string function countVowels(str) { return count; } console.log(countVowels("hello"));
Log in or sign up to run or submit your code.Log inSign up
Input
"hello"
Expected Output
2