Sum of v0w3ls

Published by Jeroen Ndh in

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 edabit!") ➞ 12

Notes

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

Watch a quick demo on how Edabit works.