Skip to content

Instantly share code, notes, and snippets.

@Ifmr24
Last active September 17, 2018 23:09
Show Gist options
  • Save Ifmr24/ecff0aa48d57a8322bb26b19172020d3 to your computer and use it in GitHub Desktop.
Save Ifmr24/ecff0aa48d57a8322bb26b19172020d3 to your computer and use it in GitHub Desktop.
JS Condicional Switch
// CONDICIONAL SWITCH
var edad = 18;
var imprime = "";
switch (edad) {
case 18:
imprime = "Tu edad es 18";
break;
case 20:
imprime = "Tu edad es 20";
break;
default:
imprime = "Tu edad es neutra";
break;
}
console.log(imprime)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment