Heath Kelley

Logo

DeltaV Coding School 102 Reading Notes

View the Project on GitHub heathkelley230/reading-notes

[Home] [Growth Mindset] [What is Markdown?] [Coder’s Computer] [Revisions in the Cloud] [Getting Started With HTML] [CSS Beginner Basics] [Dynamic Web Pages With Javascript] [Computer Architecture and Logic] [Programming with JS] [Operators and Loops]

Operators and Loops

(p. 150-151, 156-157, 170-172, 176 of Duckett Text)

Using Comparison Operators

A person can evaluate two variables with a comparison operator. Here is a list of some of the comparison operators:

Usually a condition will have at least two operands and one comparison operator. These conditions will be closed with parenthesis. Each expression after evaluated becomes a variable.

Using Logical Operators

To compare more than one expression, a person might use a logical operator. A logical operator returns a boolean value of true or false. Here is a list of some of the logical operators:

diagram of logical operators

Loops

When executed, a loop will continue if the conditions are true. If the loop is stopped with a break or returns false it will end. The three types of loops are for, while, and do while. Below is a definition of each. This website goes into more detail about these loops.

Condition Counter in For Loops

A for loop counter is a condition is made up of three stratements that will instruct the code to continue until the conditions are false or there is a break. The condition is made up of three statements. See the labeled example below.

for (var i = 20; i >= 10; i–)


Source: Duckett, J. (2014). JavaScript & jQuery : Interactive front-end web development. Indianapolis, IN: John Wiley & Sons.