View on GitHub

read-notes-corrected

Comparison and logical operators

  1. Comparison operators — operators that compare values and return true or false. The operators include: >, <, >=, <=, ===, and !==.

#### You may be familiar with comparison operators from math class. Let’s make sure there aren’t any gaps in your knowledge.

Comparison Image


  1. Logical operators — operators that combine multiple boolean expressions or values and provide a single boolean output. The operators include: &&,   , and !.

Comparison operators allow us to assert the equality of a statement with JavaScript. For example, we can assert whether two values or expressions are equal with ===, or, whether one value is greater than another with >.

#### There are scenarios, however, in which we must assert whether multiple values or expressions are true. In JavaScript, we can use logical operators to make these assertions.

logical image



Loops In JavaScript

In general wehave three types of loops in programming ; for loop , while loop and do while loop .

for loop

The for statement creates a loop that is executed as long as a condition is true. The loop will continue to run as long as the condition is true. It will only stop when the condition becomes false. JavaScript supports different kinds of loops: … for/in - loops through the properties of an object.

while loop

The while statement creates a loop that is executed while a specified condition is true. The loop will continue to run as long as the condition is true. It will only stop when the condition becomes false. JavaScript supports different kinds of loops: for - loops through a block of code a number of times.


Refernces

** JAVASCRIPT & JQUERY Interactive Front-End Web Development Book ** , which was written by ** JON DUCKETT **