← Back to challenges

Sum of v0w3ls

JavaScriptHardlogicnumbersmathlanguage_fundamentals

Instructions

Create a function that takes a string and returns the sum of vowels, where some vowels are considered numbers.

VowelNumber
A4
E3
I1
O0

Examples

sumOfVowels("Let\'s test this function.") ➞ 8

sumOfVowels("Do I get the correct output?") ➞ 10

sumOfVowels("I love innokodakademija!") ➞ 12

Notes

Vowels are case-insensitive (e.g. A = 4 and a = 4).

javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.