Guest User

Untitled

a guest
Jan 21st, 2018
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. const make_cheesecake = type => {
  2. let cheesecake = null;
  3.  
  4. switch(type){
  5. case 'oreo':
  6. cheesecake = new OreoCheesecake();
  7. break;
  8. case 'coffee':
  9. cheesecake = new CoffeeCheesecake();
  10. break;
  11. case 'tiramisu':
  12. cheesecake = new TiramisuCheesecake();
  13. break;
  14. case 'smores':
  15. cheesecake = new SmoresCheesecake();
  16. break;
  17. case 'hazelnut':
  18. cheesecake = new HazelnutCheesecake();
  19. break;
  20. default:
  21. cheesecake = new OriginalCheesecake();
  22. break;
  23. }
  24.  
  25. cheesecake.make_crust;
  26. cheesecake.add_layers;
  27. cheesecake.bake;
  28. cheesecake.refrigerate;
  29. cheesecake.add_toppings;
  30. cheesecake;
  31. }
Add Comment
Please, Sign In to add comment