String Operators

Table of contents

  1. 1. Summary
Table of contents
  1. 1. Summary

Summary

In addition to the comparison operators, which can be used on string values, the concatenation operator (+) concatenates two string values together, returning another string that is the union of the two operand strings. For example, "my " + "string" returns the string "my string".

The shorthand assignment operator += can also be used to concatenate strings. For example, if the variable mystring has the value "alpha", then the expression mystring += "bet" evaluates to "alphabet" and assigns this value to mystring.

Operator
Implemented in: JavaScript 1.0
ECMA Version: ECMA-262


Tags (0)

Edit tags
  • No tags

Attachments (0)

 

Attach file