Skip to content

Instantly share code, notes, and snippets.

@a0viedo
Forked from anonymous/jsPrimeraParte
Created August 30, 2014 03:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save a0viedo/92b2d0eca4b29a864a13 to your computer and use it in GitHub Desktop.
Save a0viedo/92b2d0eca4b29a864a13 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