/**
* To demonstrate if, if elseif ladder, switch case
*/
var numerical = 10;
if(numerical>0)
console.log("it is positive number")
if(numerical>0)
console.log("it is positive number");
else if(numerical<0)
console.log("it is negative number");
else
console.log("it is ZERO");
var fruit = "Mango";
switch(fruit){
case "Mango":{
console.log("It is green, orange or yellow in color");
break;
}
case "Watermelon":{
console.log("it is green in color");
break;
}
case "banana":{
console.log("it is green or yellow in color");
break;
}
default : {
console.log("i dont know color of this fruit : "+fruit);
break;
}
}
Output
