Liliana797979

animal type

Dec 9th, 2020
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function animalClass(arg1) {
  2.     let animal = arg1;
  3.     switch (animal) {
  4.         case "dog":
  5.             console.log("mammal");
  6.             break;
  7.         case "crocodile":
  8.         case "tortoise":
  9.         case "snake":
  10.             console.log("reptile");    
  11.             break;    
  12.         default:
  13.             console.log("unknown");
  14.             break;
  15.     }
  16. }
  17.  
  18. animalClass("cat");
Advertisement
Add Comment
Please, Sign In to add comment