Created
June 28, 2018 10:34
-
-
Save humayunahmed8/c8daed3d2277b7b3f149b8335acdcc95 to your computer and use it in GitHub Desktop.
Javascript Conditional Statement (if/else/esle-if)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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