JavaScript if else Statement

While writing a program, there may be a situation when you need to adopt one out of a given set of paths. In such cases, you need to use conditional statements that allow your program to make correct decisions and perform right actions. JavaScript supports conditional statements which are used to perform different actions based … Read more

JavaScript Control Structures (Loops and Branches).

JavaScript supports the following forms of if..else statement − if statement if…else statement if…else if… statement. if statement The if statement is the fundamental control statement that allows JavaScript to make decisions and execute statements conditionally. Syntax The syntax for a basic if statement is as follows − if (expression){ Statement(s) to be executed if … Read more

JavaScript Control Structures (Loops and Branches)

JavaScript supports the following forms of if..else statement − if statement if…else statement if…else if… statement. if statement The if statement is the fundamental control statement that allows JavaScript to make decisions and execute statements conditionally. Syntax The syntax for a basic if statement is as follows − if (expression){ Statement(s) to be executed if … Read more

Javascript Type of Operator

The typeof operator is a unary operator that is placed before its single operand, which can be of any type. Its value is a string indicating the data type of the operand. The typeof operator evaluates to “number”, “string”, or “boolean” if its operand is a number, string, or boolean value and returns true or … Read more

Miscellaneous Operator

We will discuss two operators here that are quite useful in JavaScript: theconditional operator (? 🙂 and the typeof operator. Conditional Operator (? 🙂 The conditional operator first evaluates an expression for a true or false value and then executes one of the two given statements depending upon the result of the evaluation. Sr.No Operator … Read more

JavaScript Operator

Let us take a simple expression 4 + 5 is equal to 9. Here 4 and 5 are calledoperands and ‘+’ is called the operator. JavaScript supports the following types of operators. Arithmetic Operators Comparision Operators Logical (or Relational) Operators Assignment Operators Conditional (or ternary) Operators Lets have a look on all operators one by … Read more