mirror of https://github.com/01-edu/public.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nprimo
7e594e9177
|
2 years ago | |
---|---|---|
.. | ||
README.md | 2 years ago |
README.md
veterinary
Instructions
There is a new veterinary in town!
To help him get introduced to your neighborhood, create an object veterinary
with the following properties:
-
an array of string
animalKnowledge
that will store all the animal species the new veterinary can treat, -
a function
canTreat
that will receive a string as an argument and will return a boolean indicating if the string is present in the veterinaryanimalKnowledge
array -
a function
respondClient
that will receive two string, the pet name and the animal species of the pet, and will return a string that will includeYes
orNo
plus the pet name accordingly.
Example
veterinary.animalKnowledge.push('dog')
console.log(veterinary.canTreat('dog')) // true
console.log(veterinary.respondClient('Matias', 'dog')) // 'Yes, I can treat Matias'
console.log(veterinary.respondClient('Jack', 'parrot')) // No, I cannot treat Jack'