You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//In JavaScript, the logical AND (&&) operator returns the value of the first operand if it can be converted to false; otherwise, it returns the value of the second operand.
//In this case, both operands "2" are truthy values, so the logical AND operator returns the second operand, which is "2".
console.log(" == converts [] to empty string and when empty strin is converted with other datatype it converts both the value to numbers so empty string is converted to 0 and false to 0")
}
if("")
{
console.log("empty string");
}
else{
console.log("if empty string used indiviually it is treated as false")