if statement javascript

Solutions on MaxInterview for if statement javascript by the best coders in the world

showing results for - "if statement javascript"
Philippe
10 Jul 2020
1if (time < 10) {
2  greeting = "Good morning";
3} else if (time < 20) {
4  greeting = "Good day";
5} else {
6  greeting = "Good evening";
7}
Lianne
25 Apr 2018
1console.log("abhishek");
2
Noa
27 May 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 }
Nada
19 Aug 2019
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}
Isidora
12 Apr 2016
1var age=20;
2if (age < 18) {
3	console.log("underage");
4} else {
5	console.log("let em in!");
6}
Niko
18 May 2020
1const randomObject = 5;
2if(randomObject < 2) {
3console.log("The Random Object has a value more than 2");
4}
5else {
6console.log("The Random Object has a value less than 2");
7}
similar questions
queries leading to this page
if statement javascript