JavaScript Statements

if Statement
The if statement is used to make decisions in JavaScript. Boolean operators are also
used in along with the if statement. The if statement is the most used features of JavaScript. It is basically the same in JavaScript as it is in other programming languages.

Function The function keyword identifies as a function. The parameters in the parenthesis ( ) provide a means of passing values to the function. There can be as many parameters separated by commas as you need.
This is perfectly ok to have a function with no parameters. These parameters are variables which are used by the JavaScript statements inside the curly braces { }. The variable keyword is not needed to declare the parameters in a function as variables because they are automatically declared and initialized when the function is called. The function can return a value by using the return keyword.

Conditional JavaScript if-else StatementThe JavaScript Conditional Statement used to different actions and
used to based on different conditions. you want to execute some code if a condition is true and another code
the condition is not true, use the if....else statement.