From 7e594e91774d23193b0cbdba817ee1445ae51fb5 Mon Sep 17 00:00:00 2001 From: nprimo Date: Wed, 21 Dec 2022 15:22:30 +0100 Subject: [PATCH] docs(veterinary): add subject --- subjects/veterinary/README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 subjects/veterinary/README.md diff --git a/subjects/veterinary/README.md b/subjects/veterinary/README.md new file mode 100644 index 000000000..3b456b39e --- /dev/null +++ b/subjects/veterinary/README.md @@ -0,0 +1,25 @@ +## 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 veterinary `animalKnowledge` 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 include `Yes` or `No` plus the pet name accordingly. + +### Example + +```js +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' +``` + +### Notions + +- [this](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this)