0

Question

How do I modify the function to return true if both arguments are true, and return false otherwise? console.log(areBothTrue(true,false) <— should be false console.log(areBothTrue(true,true) <— should be true

4th Jun 2019, 2:59 PM
Josh White
Josh White - avatar
1 Odpowiedź
+ 4
Okay there is a logical operator for this: && console.log(true && true) //true console.log(true && false) //false If you really want to do it with a function, it's simple: const areBothTrue = (cond1, cond2) => cond1 && cond2;
4th Jun 2019, 3:50 PM
Airree
Airree - avatar