if in javascript

JavaScript
if (condition1) {
  // code to be executed if condition1 is true
} else if (condition2) {
  // code to be executed if the condition1 is false and condition2 is true
} else {
  // code to be executed if the condition1 is false and condition2 is false
}var age=20;
if (age < 18) {
	console.log("underage");
} else {
	console.log("let em in!");
}if (x === 5 || x === 8)
  console.log("x is eaqual to 5 OR 8")// This function will be invoked right away we don't have to call it
(function () {
	console.log("This is an IIFE"); 
})();if (5 < 10) {
	console.log("5 is less than 10");
} else {
	console.log("5 is now bigger than 10")
}if(){ //Note, you cant leave if() empty. You have to put something in it, for exmaple, if(args[0] === "hi")
	//Your code here   	
}
Source

Also in JavaScript: