Simple if Statement of JavaScript

Card image cap

Simple if Statements Definition:

The if statements is the dundamental control statement that allows JavaScript to make the descisions and execute statements conditionally.

Simple if Statement specify a block of code to be executed, if a specified condition is true

Syntax:

			
	if(expression)
	{
		statements(s) to be executed if expressionis true:
	}

Flow chart:

Example :

Result :

	Display "Good day!" if the hour is less than 18:00:

	Good day!


Read Also


Card image cap