if a condition is true, execute some code if not, do something else

let time = 9;
 
if (time < 12) {
	console.log("good morning");
}
else{
	console.log("good afternoon");
}

if also accept boolean variables

let isStudent = true;
 
if(isStudent){
	console.log("you are a student");
}
else{
	console.log("you are not a student");
}