If is one of the common syntax, the format is as follows
if (Coditon) statement1 (Else Statement2)
Where Coditon can be any expression, not even a true Boolean value, because JavaScript converts it automatically to a Boolean value.
Executes statement1 if the condition execution evaluates to TRUE, and executes the result Statment2 if the condition is false (else is not required if statement2 exists)
Each conditional statement can be a single line of code, or it can be a block of code. Here are the simple examples
The code is as follows:
var inumber = number (Prompt ("Please enter a digit between 5 and 100"));
if (isNaN (Inumber))
document.write ("Please confirm the number you entered.) ");
else if (Inumber > | | inumber < 5)
document.write ("The value you entered is not in range");
Else
document.write ("The value you entered is" + inumber);