If Else Condition

If else normal use for do when we have two different value print either that will print or this will print. let write some code and see how this will work .

let age = 19;

if (age>=18){

console.log("Eligible for Vote");

}

else{

console.log("Not eligible for vote");

}

here we have age that is 19 and the condition i put here if the age greater than 18 it will print that the people is eligible for vote .else it is not eligible it is the one way where we can do if else also we have nested if else where we can put the condition as per the criteria.