Advertisement
Guest User

Untitled

a guest
Jan 28th, 2020
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. const carType ='sport'
  2.  
  3. switch (carType){
  4. case 'suv':
  5. console.log('This isnt your car type.')
  6. break
  7. case 'sedan':
  8. console.log('This isnt your car type.')
  9. break
  10. case 'truck':
  11. console.log('This isnt your car type.')
  12. break
  13. case 'sport':
  14. console.log('This is your car type.')
  15. break
  16. default:
  17. console.log('Found nothing');
  18.  
  19. }
  20.  
  21. //Create your own switch
  22.  
  23.  
  24. const diffSchools = 'GBC';
  25.  
  26. switch(diffSchools){
  27. case "GBC":
  28. console.log('This is your school');
  29. break;
  30. case 'York':
  31. console.log("This is not your school");
  32. break;
  33. case 'University of Toronto':
  34. console.log("This is not your school");
  35. break;
  36. case 'Ryerson':
  37. console.log("This is not your school");
  38. break;
  39. case 'Seneca':
  40. console.log("This is not your school");
  41. break;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement