Skip to content

Instantly share code, notes, and snippets.

@humayunahmed8
Created June 28, 2018 10:34
Show Gist options
  • Save humayunahmed8/c8daed3d2277b7b3f149b8335acdcc95 to your computer and use it in GitHub Desktop.
Save humayunahmed8/c8daed3d2277b7b3f149b8335acdcc95 to your computer and use it in GitHub Desktop.
Javascript Conditional Statement (if/else/esle-if)
// Conditonal Statement
var x = 30;
var y = 20;
// If Statement
if(x>y){
document.write('Hello World');
}
// Else Statement
if(x>y){
document.write('Hello World');
}else{
document.write('Hello Javascript');
}
// Else if Statemet
var x = 100;
var y = 20;
var z = 40;
if(x<y){
document.write('Hello World');
} else if(y>z){
document.write('Hello Javascript');
} else if(z<x){
document.write('Hello RRF');
} else{
document.write('Hello Dhaka');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment