Assignment operators, assign value to its left and right operand. A simple assignment operator is the equal sign, but there are much more versions that can be used.
A comparison operator compares its operands and returns a logical value based on whether the comparison is true. The operands can be numerical, logical, string, or object values.
Loops offer a quick and easy way to do something repeatedly. There are many different types of loops:
A for loop, repeats until a specified conditon evaluates to false.
EXAMPLE:
Here is a break down of what is going on:
Key Note: If the conditionExpression expression is omitted entirely, the condition is assumed to be true.
A while statement executes its statements as long as a specified condition evaluates to true.
EXAMPLE:
The condition test occurs before statement in the loop is executed. If the condition returns true, statement is executed and the condition is tested again. If the condition returns false, execution stops, and control is passed to the statement following while.