HTML and CSS Reference
Figure 5.7 Concatenation of a string and a number.
Table 5.5 The Concatenation Operator
"hot" + "dog"
Concatenates (joins) two strings; creates "hotdog" .
"22" + 8
Converts number 8 to string "8" , then concatenates
resulting in "228" . In statements involving other
values to strings.
x ="cow"; x += "boy";
Concatenates two strings and assigns the result to x ;
x becomes "cowboy" .
When operands are compared, relational and equality operators are used. The operands
can be numbers or strings. The result of the comparison is either true or false —a Boolean
value. Strings are compared letter by letter (lexographically) using Unicode 1 values to rep-
resent the numeric value of each letter; thus, “A” is less than “B”, and when comparing
pads “Dan” with three spaces to make it the same length as “ Daniel ”. Refer to Table 5.6.
Table 5.6 Comparison Operators
x == y
x is equal to y
x != y
x is not equal to y
x > y
x is greater than y
ters. The first 128 Unicode characters correspond to the ASCII character set and have the same byte value.