-
-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy path101dalmations.js
More file actions
17 lines (11 loc) · 608 Bytes
/
101dalmations.js
File metadata and controls
17 lines (11 loc) · 608 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/*
Your friend has been out shopping for puppies (what a time to be alive!)... He arrives back with multiple dogs, and you simply do not know how to respond!
By repairing the function provided, you will find out exactly how you should respond, depending on the number of dogs he has.
The number of dogs will always be a number and there will always be at least 1 dog.
*/
//Answer//
function howManyDalmatians(n)
{
var dogs = ["Hardly any", "More than a handful!", "Woah that's a lot of dogs!", "101 DALMATIANS!!!"];
return n <= 10 ? dogs[0] : n <= 50 ? dogs[1] : n == 101 ? dogs[3] : dogs[2]
}'