0
Q:

else if 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
}
19
if (condition1) {
  //  block of code to be executed if condition1 is true
} else if (condition2) {
  //  block of code to be executed if the condition1 is false and condition2 is true
} else {
  //  block of code to be executed if the condition1 is false and condition2 is false
}
37
if( name = 'george washington'):
	print("You have the same name as the first president of the United States")
    // python 
else:
	print("You do not have the same name as George Washington")
4
<script type = "text/javaScript"> 
// JavaScript program to illustrate nested-if statement 
  
var i = 20; 
  
if (i == 10) 
  document.write("i is 10"); 
else if (i == 15) 
  document.write("i is 15"); 
else if (i == 20) 
  document.write("i is 20"); 
else
  document.write("i is not present"); 
< /script> 
2
var age=20;
if (age < 18) {
	console.log("underage");
} else {
	console.log("let em in!");
}
27

if (hour < 18) {

    greeting = "Good day";

 }
else {

    greeting = "Good evening";

 }
 
5
if (5 < 10) {
	console.log("5 is less than 10");
} else {
	console.log("5 is now bigger than 10")
}
6
if (condion):
   result
    
elif (condition):
   results
    
else:
   result
6
let A = 1;
let B = 0;
if (A == 1 || B == 1){
  	// some code here
}
4

if (condition) {

  //  block of code to be executed if the condition is true

 }

 
5

New to Communities?

Join the community