elibraryportal Logo

JS Statements

Js statement check the condition true or False.

Types of Statements.

  1. If Statement
  2. If else statement
  3. if else if statement

1) If Statement

if statement is used to test the condition this statements get execute only when the given condition is true. If the condition is false then the statements inside if statement body are completely ignored.

Syntax:

if statement in java

Example:

Test it Now

2) If else statement

if-else statement also tests the condition. when if condition is true then print your if body statement, else part statement do not tuch.

Otherwise if part statement is false then else block is executed.

Syntax:

Example:

Test it Now

3) if else if statement

Executes one condition in Multiple statements.

Syntax

Example:

Test it Now
Next Topic