showing results for - "if condition javascript"
Oscar
17 Sep 2018
1if (time < 10) {
2  greeting = "Good morning";
3} else if (time < 20) {
4  greeting = "Good day";
5} else {
6  greeting = "Good evening";
7}
Emilie
03 Jan 2019
1if (condition1) {
2  //  block of code to be executed if condition1 is true
3 }
4else if (condition2) {
5  //  block of code to be executed if the condition1 is false and 
6  //  condition2 is true
7} else {
8  //  block of code to be executed if the condition1 is false and 
9  //  condition2 is false
10 }
Trenton
27 Mar 2018
1if (condition1) {
2  // code to be executed if condition1 is true
3} else if (condition2) {
4  // code to be executed if the condition1 is false and condition2 is true
5} else {
6  // code to be executed if the condition1 is false and condition2 is false
7}
Gianluca
14 Feb 2019
1var age=20;
2if (age < 18) {
3	console.log("underage");
4} else {
5	console.log("let em in!");
6}
Romeo
22 Oct 2018
1if (condition1) {
2  //  block of code to be executed if condition1 is true
3} else {
4  //  block of code to be executed if the condition1 is false
5}
Charlene
06 Feb 2018
1if (condition){
2// if true then execute this -}
3 else{
4 // if statment is not true then execut this -
5 }
similar questions
queries leading to this page
if condition javascript