HTML and CSS Reference
Figure 5.5 Output from Example 5.5. Auto-increment and auto-decrement operators.
As shown in previous examples, the + sign is used for concatenation and addition. The
concatenation operator, the + sign, is a string operator used to join together one or more
In the example, “correct” + “tion” + “al” , the result is “correctional” . If the operands
example, “22” + 8 results in “228” , not 30 . If the operands are numbers, then the + sign
is the addition operator as in 5 + 4 . But suppose we say, “22” * 1 + 4 . In this case, Java-
Script sees the multiplication operator (*) and converts the string “22” to a number,
as shown in Figures 5.6 and 5.7.
The concatenation operator is summarized in Table 5.5. To explicitly convert strings
discussed in Sections 5.3.1 and 5.3.2, respectively.
displayed in the browser window.