Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function animalType(input) {
- let type = input[0];
- switch (type) {
- case "dog":
- console.log("mammal");
- break;
- case "crocodile":
- case "tortoise":
- case "snake":
- console.log("reptile");
- break;
- default:
- console.log("unknown");
- break;
- }
- }
- animalType(["dog"])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement