Expression | Result |
---|---|
1 + 1 | 2 |
-3 + 27.2 | 24.2 |
"1" + "1" | "11" |
"cat" + 1 | "cat1" |
1 + "cat" | "1cat" |
"cat" + "ch" | "catch" |
"cat" + " door" | "cat door" |
"27.15" + "0.2" | "27.150.2" |
These examples show the plus operator doing three quite different things:
|