Skip to content

Instantly share code, notes, and snippets.

@edinsoncs
Created October 22, 2015 05:09
Show Gist options
  • Save edinsoncs/b5ee09e1e087dd6283d1 to your computer and use it in GitHub Desktop.
Save edinsoncs/b5ee09e1e087dd6283d1 to your computer and use it in GitHub Desktop.
Reverse
/*Reverse*/
function familyReverse(hermanos, primos, tios, familia) {
var hermanos, primos, tios, familia;
var hermanos = new Array("edinson", "richard", "luis", "aslhy");
var primos = new Array("Juan", "Adrean", "Albert", "Jherson");
var tios = new Array("Adelino", "Alindor", "Eliseo", "Isidro")
var i = 0;
var t = prompt("Escribe solo una vocal");
while(i < hermanos.length && i < primos.length && i < tios.length) {
if(t.length == 1) {
familia = "To Hermanos reverse: " + hermanos.reverse() +"----"+ "To Primos reverse: " + primos.reverse() +"----"+ "To Tios reverse: " +tios.reverse();
console.log(familia);
}
else if(t.length == 2 || t.length == 3 || t.length == 4 || t.length == 5) {
console.log("Error Incorrecto Ingresastes: " + t.length + " vocales");
}
else {
console.log("Atention: view description plz");
}
i++
}
return familia;
}
familyReverse();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment