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