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.
 
 
 
 
 
 
Clement Denis 0e67e834e5 update discovery-piscine subjects and tests 4 years ago
..
README.md update discovery-piscine subjects and tests 4 years ago

README.md

🌟 Happy ?

Notions

Instructions

With all that you know now you are not a truly happy, efficient and independent robot.

You have decided that if someone ask you the question Are you happy ? or questions that includes the word happy you will always says that it is true. To do so you will declare the function happy which takes only one argument and returns a boolean.

Examples:

console.log(happy('Are you happy ?')) // true
console.log(happy('Happy ?')) // true
console.log(happy('Are you happy!')) // false  -> this is not a question
console.log(happy('Are you sad ?')) // false  -> wrong question

Any other requests will be denied with a false. (if it is not a question of if it does not have the word happy).

And because you aim for efficiency you will contruct your fonction without the curlys brackets {} and without the keyword return or if.