Sum 0f v0w3ls

Published by Deep Xavier 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("My world evolves around Tesha's.") ➞ 17

sumOfVowels("Apparently, a heart that beats for no one, but for Tesh.") ➞ 39

sumOfVowels("I will be forever yours, babe.") ➞ 18

sumOfVowels("To each, his own.") ➞ 8

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.