Skip to content

Instantly share code, notes, and snippets.

Created August 29, 2014 22:17
Show Gist options
  • Save anonymous/7b58a770463299e32ac9 to your computer and use it in GitHub Desktop.
Save anonymous/7b58a770463299e32ac9 to your computer and use it in GitHub Desktop.
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