if: if statement is the most simple decision making statement. It is used to decide whether a certain statement or block of statements will be executed or not i.e if a certain condition is true then a block of statement is executed otherwise not. Here, condition after evaluation will be either true or false.
What does IF statement mean?
An if statement is a programming conditional statement that, if proved true, performs a function or displays information. … In the example above, if the value of X were equal to any number less than 10, the program displays, “Hello John” when the script is run.
What is else if?
Alternatively referred to as elsif, else if is a conditional statement performed after an if statement that, if true, performs a function. … The above example shows how elsif could be used to create an additional conditional statement and not only an if or else statement.
The triple equals operator ( === ) returns true if both operands are of the same type and contain the same value. If comparing different types for equality, the result is false. This definition of equality is enough for most use cases. When comparing the string “0” and the number 0 the result is false as expected.
What is nested IF statement?
Nested IF functions, meaning one IF function inside of another, allow you to test multiple criteria and increases the number of possible outcomes.
Where is IIFE used?
An Immediately-invoked Function Expression (IIFE for friends) is a way to execute functions immediately, as soon as they are created. IIFEs are very useful because they don’t pollute the global object, and they are a simple way to isolate variables declarations.