Skip to content

Instantly share code, notes, and snippets.

@ruprict
Created June 22, 2012 09:39
Show Gist options
  • Select an option

  • Save ruprict/2971703 to your computer and use it in GitHub Desktop.

Select an option

Save ruprict/2971703 to your computer and use it in GitHub Desktop.
switch (food) {
case "fish":
cook(bake);
break;
case "steak":
cook(grill);
break;
case "french fries":
cook(fry);
break;
case "sashimi":
cook(none);
break;
case "apple"
if (appleSeason === true)
cook(none);
} else {
cook(bake);
}
break;
case "water":
cook(boil);
break;
default:
cook(pan);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment