October 2008
Beginner to intermediate
544 pages
13h 21m
English
You’ll often want to compare the value of one variable with another, or the value of a variable against a literal value (i.e., a value typed into the expression). For example, you might want to compare the value of the day of the week to “Tuesday”, and you can do this by checking if todaysDate == "Tuesday" (note that double equal sign). A complete list of comparisons is in Table 1.5.
| Comparison | What it does |
|---|---|
| x == y | Returns true if x and y are equal |
| x != y | Returns true if x and y are not equal |
| x > y | Returns true if x is greater than y |
| x > = y | Returns true if x is greater than or equal to y |
| x < y | Returns true if x is less than y |
| x <= y | Returns true if x is less than or equal to y |
| x && y | Returns true if both x and y are true |
Read now
Unlock full access