reading-notes

Duckett: JavaScript & jQuery:

Comparison and logical operators: 150-151, 156, and 157:

COMPARISON OPERATORS: EVALUATING CONDITIONS:

the result will be a boolean: true or false

eight operators to comparing:

  1. == , is equal to , (compares two values to see if they are the same).
  2. != , is not equal to , (compares two values to see if they are not the same)
  3. === , strict equal to , (compares two values to see if the data type and the values are the same )
  4. !== , strict not equal to , (compares two values to see if the data type and the values are not the same )
  5. > , greater than
  6. < , less than
  7. >= , greater than or equal to
  8. <= , less than or equal to

logical operators:

A logical operator is a symbol or word used to connect two or more expressions such that the value of the compound expression produced depends only on that of the original expressions and on the meaning of the operator. Common logical operators include AND, OR, and NOT.

AND , &&

the logical AND ( && ) operator (logical conjunction) for a set of operands is true if and only if all of its operands are true.

OR , ||

the logical OR operator ( || ) returns the boolean value true if either or both operands is true and returns false otherwise

NOT , !

the logical NOT (!) operator (logical complement, negation) takes truth to falsity and vice versa.

for and while loops: 170 - 173, and 176

a loop is a programming structure that repeats a sequence of instructions until a specific condition is met.

for

javaScript For Loop ยท JavaScript Loops. Loops are handy, if you want to run the same code over and over again, each time with a different value.

var i;
for (i = 0; i < cars.length; i++) {
  text += cars[i] + "<br>";
}

the While Loop.

the While Loop. The while loop loops through a block of code as long as a specified condition is true.

while (i < 10) {
  text += "The number is " + i;
  i++;
}