-
-
Save a0viedo/92b2d0eca4b29a864a13 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sumar(parametro1, parametro){ | |
return parametro1 + parametro; | |
} | |
console.log(contarvocales("coderhouse")); | |
function contarvocales(string){ | |
var totaldevocales = 0; | |
for(var i = 0 ; i<string.length ; i =i+1){ | |
if (esvocal(string[i])) { | |
totaldevocales = totaldevocales +1; | |
} | |
} | |
return totaldevocales; | |
} | |
function esvocal(string){ | |
if (string == "a"||string == "e"||string == "i"||string == "o"||string == "u"){ | |
return true; | |
} | |
else{ | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment