logical operators = used to combine or manipulate boolean values (true/false)
- and =
&& - or =
|| - not =
!
const temp = 20;
if(temp > 0 && temp <= 30){
console.log("the weather is good");
}
else{
console.log("the weather is bad");
}
if(temp <= 0 || temp > 30){
console.log("the weather is bad");
}
else{
console.log("the weather is good");
}
const isSunny = ture;
if(!isSunny){
console.log("it is cloudy");
}
else{
console.log("it is sunny")
}