Concatenation

String concatenation

Using the plus sign, + , joins two string values.

Concatenating two strings representing numbers combines them as if they were letters.

> '1' + '2'
= 12

Concatenating a string and a number returns a numeric value. If a number is present in the operation, string data is implicitly coerced to a number.

> '1' + 2
= '12'