// The logical AND (&&) operator for a set of boolean operands will be true if
// and only if all the operands are true
const a = 3;
const b = -2;
console.log(a > 0 && b > 0); // false
// Logical AND (&&) evaluates operands from left to right,
// returning immediately with the value of the first falsy
const a = 3; // a -> truthy
const b = 0; // b -> falsy
console.log(a && b ); // 0
// Can be replaced with Optional chaining. Eg:
myData?.results;
//one way condition
x=2
x === 3 && console.log("i am 3");
this will not output because of x equal 2. This is work when correct;
if(x===3){
console.log("i am 3")
}
if(condition){
(this part will execute)
}
(if this part is true) && (this part will execute)