//Opción 1: function getCount(str) { const vocal = str.match(/[aeiou]/ig); return vocal === null ? 0 : vocal.length; //si no hay vocales devuelve 0, si hay devuelve la cantidad } //Opción 2: function getCount(str) { return str.replace(/[^aeiou]/gi, '').length; } //Opción 3: function getCount(str) { return (str.match(/[aeiou]/ig)||[]).length; }