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
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;