If statements code example

Example 1: if statement

if( ID = josh ):
	print("ID confirmed")
    // python
else:
	print("ID does not exist")

Example 2: IF else statement

var age=20;
if (age < 18) {
	console.log("underage");
} else {
	console.log("let em in!");
}

Example 3: IF else statement

var age=20;
if (age < 18) {
	console.log("underage");
} else {
	console.log("let em in!");
}

Example 4: using if statements in javascript

if (expression) {
   Statement(s) to be executed if expression is true
} else {
   Statement(s) to be executed if expression is false
}

Example 5: javascript if statement

if (5 < 10) {
	console.log("5 is less than 10");
} else {
	console.log("5 is now bigger than 10")
}

Example 6: IF STATEMENT WHAT IS IT

if (X < 10) {
 print "Hello John";
}

Tags: