The logical operators are used to perform logical operations on the values, they are used along with the comparison operators mostly.
The logical operator NOT is used to inverse the value upon which it is used. It is represented by the exclamation mark (!) symbol.
The logical AND operator is used to evaluate all the values from the expression. It is represented by using the two ampersands (&&). The AND operator returns true in case of all the conditions in the expression are true.

What is a JavaScript Loop?
JavaScript Loop provides a quick and easy way to do repetitive tasks. They offer to perform iterations with only a few lines of code. Iteration is the number of times you want to repeat the task (that number can even be zero).
A while statement in JavaScript executes until our boolean condition evaluates to true. This loop is an entry controlled loop.
- If the test condition returns false, then control passes to the statement just after the loop.
- If the test condition returns true, the loop body is executed and the condition is tested again.
JavaScript for loops are similar to Java and C language for loops. It’s an entry controlled loop. It consists of three parts, separated with a semicolon:
- Initialization: It initializes the loop with an iteration variable and executes once at the beginning of the loop.
- Condition: It specifies a certain condition in the loop that determines whether the loop body will execute or not. If the condition returns true, the code inside the for loop will execute. If it returns false, the control moves onto the statement after the loop.
- Increment/ Decrement: This section increments or decrements the value of our iteration variable by 1.
This is an exit controlled loop; the loop body executes at least once, even if the condition is not true. This is because the condition is tested when the loop body ends. If the condition returns true, the code inside the loop executes again. If it returns false, the JavaScript interpreter exits the loop.




